Please wait. This can take some minutes ...
Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance.
Project price only 1 $
You can buy this project and download/modify it how often you want.
com.pulumi.azure.securitycenter.kotlin.SubscriptionPricing.kt Maven / Gradle / Ivy
@file:Suppress("NAME_SHADOWING", "DEPRECATION")
package com.pulumi.azure.securitycenter.kotlin
import com.pulumi.azure.securitycenter.kotlin.outputs.SubscriptionPricingExtension
import com.pulumi.azure.securitycenter.kotlin.outputs.SubscriptionPricingExtension.Companion.toKotlin
import com.pulumi.core.Output
import com.pulumi.kotlin.KotlinCustomResource
import com.pulumi.kotlin.PulumiTagMarker
import com.pulumi.kotlin.ResourceMapper
import com.pulumi.kotlin.options.CustomResourceOptions
import com.pulumi.kotlin.options.CustomResourceOptionsBuilder
import com.pulumi.resources.Resource
import kotlin.Boolean
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.List
/**
* Builder for [SubscriptionPricing].
*/
@PulumiTagMarker
public class SubscriptionPricingResourceBuilder internal constructor() {
public var name: String? = null
public var args: SubscriptionPricingArgs = SubscriptionPricingArgs()
public var opts: CustomResourceOptions = CustomResourceOptions()
/**
* @param name The _unique_ name of the resulting resource.
*/
public fun name(`value`: String) {
this.name = value
}
/**
* @param block The arguments to use to populate this resource's properties.
*/
public suspend fun args(block: suspend SubscriptionPricingArgsBuilder.() -> Unit) {
val builder = SubscriptionPricingArgsBuilder()
block(builder)
this.args = builder.build()
}
/**
* @param block A bag of options that control this resource's behavior.
*/
public suspend fun opts(block: suspend CustomResourceOptionsBuilder.() -> Unit) {
this.opts = com.pulumi.kotlin.options.CustomResourceOptions.opts(block)
}
internal fun build(): SubscriptionPricing {
val builtJavaResource =
com.pulumi.azure.securitycenter.SubscriptionPricing(
this.name,
this.args.toJava(),
this.opts.toJava(),
)
return SubscriptionPricing(builtJavaResource)
}
}
/**
* Manages the Pricing Tier for Azure Security Center in the current subscription.
* > **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", {
* tier: "Standard",
* resourceType: "VirtualMachines",
* });
* ```
* ```python
* import pulumi
* import pulumi_azure as azure
* example = azure.securitycenter.SubscriptionPricing("example",
* tier="Standard",
* resource_type="VirtualMachines")
* ```
* ```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()
* {
* Tier = "Standard",
* ResourceType = "VirtualMachines",
* });
* });
* ```
* ```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{
* Tier: pulumi.String("Standard"),
* ResourceType: pulumi.String("VirtualMachines"),
* })
* if err != nil {
* return err
* }
* return nil
* })
* }
* ```
* ```java
* package generated_program;
* import com.pulumi.Context;
* import com.pulumi.Pulumi;
* import com.pulumi.core.Output;
* import com.pulumi.azure.securitycenter.SubscriptionPricing;
* import com.pulumi.azure.securitycenter.SubscriptionPricingArgs;
* import java.util.List;
* import java.util.ArrayList;
* import java.util.Map;
* import java.io.File;
* import java.nio.file.Files;
* import java.nio.file.Paths;
* public class App {
* public static void main(String[] args) {
* Pulumi.run(App::stack);
* }
* public static void stack(Context ctx) {
* var example = new SubscriptionPricing("example", SubscriptionPricingArgs.builder()
* .tier("Standard")
* .resourceType("VirtualMachines")
* .build());
* }
* }
* ```
* ```yaml
* resources:
* example:
* type: azure:securitycenter:SubscriptionPricing
* properties:
* tier: Standard
* resourceType: VirtualMachines
* ```
*
* ### 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", {
* tier: "Standard",
* resourceType: "CloudPosture",
* extensions: [
* {
* name: "ContainerRegistriesVulnerabilityAssessments",
* },
* {
* name: "AgentlessVmScanning",
* additionalExtensionProperties: {
* ExclusionTags: "[]",
* },
* },
* {
* name: "AgentlessDiscoveryForKubernetes",
* },
* {
* name: "SensitiveDataDiscovery",
* },
* ],
* });
* ```
* ```python
* import pulumi
* import pulumi_azure as azure
* example1 = azure.securitycenter.SubscriptionPricing("example1",
* tier="Standard",
* resource_type="CloudPosture",
* extensions=[
* {
* "name": "ContainerRegistriesVulnerabilityAssessments",
* },
* {
* "name": "AgentlessVmScanning",
* "additional_extension_properties": {
* "exclusion_tags": "[]",
* },
* },
* {
* "name": "AgentlessDiscoveryForKubernetes",
* },
* {
* "name": "SensitiveDataDiscovery",
* },
* ])
* ```
* ```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()
* {
* Tier = "Standard",
* ResourceType = "CloudPosture",
* Extensions = new[]
* {
* new Azure.SecurityCenter.Inputs.SubscriptionPricingExtensionArgs
* {
* Name = "ContainerRegistriesVulnerabilityAssessments",
* },
* new Azure.SecurityCenter.Inputs.SubscriptionPricingExtensionArgs
* {
* Name = "AgentlessVmScanning",
* AdditionalExtensionProperties =
* {
* { "ExclusionTags", "[]" },
* },
* },
* new Azure.SecurityCenter.Inputs.SubscriptionPricingExtensionArgs
* {
* Name = "AgentlessDiscoveryForKubernetes",
* },
* new Azure.SecurityCenter.Inputs.SubscriptionPricingExtensionArgs
* {
* Name = "SensitiveDataDiscovery",
* },
* },
* });
* });
* ```
* ```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{
* Tier: pulumi.String("Standard"),
* ResourceType: pulumi.String("CloudPosture"),
* Extensions: securitycenter.SubscriptionPricingExtensionArray{
* &securitycenter.SubscriptionPricingExtensionArgs{
* Name: pulumi.String("ContainerRegistriesVulnerabilityAssessments"),
* },
* &securitycenter.SubscriptionPricingExtensionArgs{
* Name: pulumi.String("AgentlessVmScanning"),
* AdditionalExtensionProperties: pulumi.StringMap{
* "ExclusionTags": pulumi.String("[]"),
* },
* },
* &securitycenter.SubscriptionPricingExtensionArgs{
* Name: pulumi.String("AgentlessDiscoveryForKubernetes"),
* },
* &securitycenter.SubscriptionPricingExtensionArgs{
* Name: pulumi.String("SensitiveDataDiscovery"),
* },
* },
* })
* if err != nil {
* return err
* }
* return nil
* })
* }
* ```
* ```java
* package generated_program;
* import com.pulumi.Context;
* import com.pulumi.Pulumi;
* import com.pulumi.core.Output;
* import com.pulumi.azure.securitycenter.SubscriptionPricing;
* import com.pulumi.azure.securitycenter.SubscriptionPricingArgs;
* import com.pulumi.azure.securitycenter.inputs.SubscriptionPricingExtensionArgs;
* import java.util.List;
* import java.util.ArrayList;
* import java.util.Map;
* import java.io.File;
* import java.nio.file.Files;
* import java.nio.file.Paths;
* public class App {
* public static void main(String[] args) {
* Pulumi.run(App::stack);
* }
* public static void stack(Context ctx) {
* var example1 = new SubscriptionPricing("example1", SubscriptionPricingArgs.builder()
* .tier("Standard")
* .resourceType("CloudPosture")
* .extensions(
* SubscriptionPricingExtensionArgs.builder()
* .name("ContainerRegistriesVulnerabilityAssessments")
* .build(),
* SubscriptionPricingExtensionArgs.builder()
* .name("AgentlessVmScanning")
* .additionalExtensionProperties(Map.of("ExclusionTags", "[]"))
* .build(),
* SubscriptionPricingExtensionArgs.builder()
* .name("AgentlessDiscoveryForKubernetes")
* .build(),
* SubscriptionPricingExtensionArgs.builder()
* .name("SensitiveDataDiscovery")
* .build())
* .build());
* }
* }
* ```
* ```yaml
* resources:
* example1:
* type: azure:securitycenter:SubscriptionPricing
* properties:
* tier: Standard
* resourceType: CloudPosture
* extensions:
* - name: ContainerRegistriesVulnerabilityAssessments
* - name: AgentlessVmScanning
* additionalExtensionProperties:
* ExclusionTags: '[]'
* - name: AgentlessDiscoveryForKubernetes
* - name: SensitiveDataDiscovery
* ```
*
* ## Import
* The pricing tier can be imported using the `resource id`, e.g.
* ```sh
* $ pulumi import azure:securitycenter/subscriptionPricing:SubscriptionPricing example /subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Security/pricings/
* ```
*/
public class SubscriptionPricing internal constructor(
override val javaResource: com.pulumi.azure.securitycenter.SubscriptionPricing,
) : KotlinCustomResource(javaResource, SubscriptionPricingMapper) {
/**
* One or more `extension` blocks as defined below.
*/
public val extensions: Output>?
get() = javaResource.extensions().applyValue({ args0 ->
args0.map({ args0 ->
args0.map({ args0 ->
args0.let({ args0 -> toKotlin(args0) })
})
}).orElse(null)
})
/**
* The resource type this setting affects. Possible values are `Api`, `AppServices`, `ContainerRegistry`, `KeyVaults`, `KubernetesService`, `SqlServers`, `SqlServerVirtualMachines`, `StorageAccounts`, `VirtualMachines`, `Arm`, `Dns`, `OpenSourceRelationalDatabases`, `Containers`, `CosmosDbs` and `CloudPosture`. Defaults to `VirtualMachines`
*/
public val resourceType: Output?
get() = javaResource.resourceType().applyValue({ args0 ->
args0.map({ args0 ->
args0
}).orElse(null)
})
/**
* Resource type pricing subplan. Contact your MSFT representative for possible values.
*/
public val subplan: Output?
get() = javaResource.subplan().applyValue({ args0 -> args0.map({ args0 -> args0 }).orElse(null) })
/**
* The pricing tier to use. Possible values are `Free` and `Standard`.
*/
public val tier: Output
get() = javaResource.tier().applyValue({ args0 -> args0 })
}
public object SubscriptionPricingMapper : ResourceMapper {
override fun supportsMappingOfType(javaResource: Resource): Boolean =
com.pulumi.azure.securitycenter.SubscriptionPricing::class == javaResource::class
override fun map(javaResource: Resource): SubscriptionPricing = SubscriptionPricing(
javaResource
as com.pulumi.azure.securitycenter.SubscriptionPricing,
)
}
/**
* @see [SubscriptionPricing].
* @param name The _unique_ name of the resulting resource.
* @param block Builder for [SubscriptionPricing].
*/
public suspend fun subscriptionPricing(
name: String,
block: suspend SubscriptionPricingResourceBuilder.() -> Unit,
): SubscriptionPricing {
val builder = SubscriptionPricingResourceBuilder()
builder.name(name)
block(builder)
return builder.build()
}
/**
* @see [SubscriptionPricing].
* @param name The _unique_ name of the resulting resource.
*/
public fun subscriptionPricing(name: String): SubscriptionPricing {
val builder = SubscriptionPricingResourceBuilder()
builder.name(name)
return builder.build()
}