com.pulumi.azure.mssql.kotlin.DatabaseVulnerabilityAssessmentRuleBaselineArgs.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of pulumi-azure-kotlin Show documentation
Show all versions of pulumi-azure-kotlin Show documentation
Build cloud applications and infrastructure by combining the safety and reliability of infrastructure as code with the power of the Kotlin programming language.
@file:Suppress("NAME_SHADOWING", "DEPRECATION")
package com.pulumi.azure.mssql.kotlin
import com.pulumi.azure.mssql.DatabaseVulnerabilityAssessmentRuleBaselineArgs.builder
import com.pulumi.azure.mssql.kotlin.inputs.DatabaseVulnerabilityAssessmentRuleBaselineBaselineResultArgs
import com.pulumi.azure.mssql.kotlin.inputs.DatabaseVulnerabilityAssessmentRuleBaselineBaselineResultArgsBuilder
import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiTagMarker
import com.pulumi.kotlin.applySuspend
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.List
import kotlin.jvm.JvmName
/**
* Manages a Database Vulnerability Assessment Rule Baseline.
* > **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 example = new azure.core.ResourceGroup("example", {
* name: "example-resources",
* location: "West Europe",
* });
* const exampleSqlServer = new azure.sql.SqlServer("example", {
* name: "mysqlserver",
* resourceGroupName: example.name,
* location: example.location,
* version: "12.0",
* administratorLogin: "4dm1n157r470r",
* administratorLoginPassword: "4-v3ry-53cr37-p455w0rd",
* });
* const exampleAccount = new azure.storage.Account("example", {
* name: "accteststorageaccount",
* resourceGroupName: example.name,
* location: example.location,
* accountTier: "Standard",
* accountReplicationType: "GRS",
* });
* const exampleContainer = new azure.storage.Container("example", {
* name: "accteststoragecontainer",
* storageAccountName: exampleAccount.name,
* containerAccessType: "private",
* });
* const exampleServerSecurityAlertPolicy = new azure.mssql.ServerSecurityAlertPolicy("example", {
* resourceGroupName: example.name,
* serverName: exampleSqlServer.name,
* state: "Enabled",
* });
* const exampleDatabase = new azure.sql.Database("example", {
* name: "mysqldatabase",
* resourceGroupName: example.name,
* serverName: exampleSqlServer.name,
* location: example.location,
* edition: "Standard",
* });
* const exampleServerVulnerabilityAssessment = new azure.mssql.ServerVulnerabilityAssessment("example", {
* serverSecurityAlertPolicyId: exampleServerSecurityAlertPolicy.id,
* storageContainerPath: pulumi.interpolate`${exampleAccount.primaryBlobEndpoint}${exampleContainer.name}/`,
* storageAccountAccessKey: exampleAccount.primaryAccessKey,
* });
* const exampleDatabaseVulnerabilityAssessmentRuleBaseline = new azure.mssql.DatabaseVulnerabilityAssessmentRuleBaseline("example", {
* 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",
* ],
* },
* ],
* });
* ```
* ```python
* import pulumi
* import pulumi_azure as azure
* example = azure.core.ResourceGroup("example",
* name="example-resources",
* location="West Europe")
* example_sql_server = azure.sql.SqlServer("example",
* name="mysqlserver",
* resource_group_name=example.name,
* location=example.location,
* version="12.0",
* administrator_login="4dm1n157r470r",
* administrator_login_password="4-v3ry-53cr37-p455w0rd")
* example_account = azure.storage.Account("example",
* name="accteststorageaccount",
* resource_group_name=example.name,
* location=example.location,
* account_tier="Standard",
* account_replication_type="GRS")
* example_container = azure.storage.Container("example",
* name="accteststoragecontainer",
* storage_account_name=example_account.name,
* container_access_type="private")
* example_server_security_alert_policy = azure.mssql.ServerSecurityAlertPolicy("example",
* resource_group_name=example.name,
* server_name=example_sql_server.name,
* state="Enabled")
* example_database = azure.sql.Database("example",
* name="mysqldatabase",
* resource_group_name=example.name,
* server_name=example_sql_server.name,
* location=example.location,
* edition="Standard")
* example_server_vulnerability_assessment = azure.mssql.ServerVulnerabilityAssessment("example",
* 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("example",
* 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",
* ],
* ),
* ])
* ```
* ```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()
* {
* Name = "example-resources",
* Location = "West Europe",
* });
* var exampleSqlServer = new Azure.Sql.SqlServer("example", new()
* {
* Name = "mysqlserver",
* ResourceGroupName = example.Name,
* Location = example.Location,
* Version = "12.0",
* AdministratorLogin = "4dm1n157r470r",
* AdministratorLoginPassword = "4-v3ry-53cr37-p455w0rd",
* });
* var exampleAccount = new Azure.Storage.Account("example", new()
* {
* Name = "accteststorageaccount",
* ResourceGroupName = example.Name,
* Location = example.Location,
* AccountTier = "Standard",
* AccountReplicationType = "GRS",
* });
* var exampleContainer = new Azure.Storage.Container("example", new()
* {
* Name = "accteststoragecontainer",
* StorageAccountName = exampleAccount.Name,
* ContainerAccessType = "private",
* });
* var exampleServerSecurityAlertPolicy = new Azure.MSSql.ServerSecurityAlertPolicy("example", new()
* {
* ResourceGroupName = example.Name,
* ServerName = exampleSqlServer.Name,
* State = "Enabled",
* });
* var exampleDatabase = new Azure.Sql.Database("example", new()
* {
* Name = "mysqldatabase",
* ResourceGroupName = example.Name,
* ServerName = exampleSqlServer.Name,
* Location = example.Location,
* Edition = "Standard",
* });
* var exampleServerVulnerabilityAssessment = new Azure.MSSql.ServerVulnerabilityAssessment("example", 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("example", 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",
* },
* },
* },
* });
* });
* ```
* ```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 {
* example, err := core.NewResourceGroup(ctx, "example", &core.ResourceGroupArgs{
* Name: pulumi.String("example-resources"),
* Location: pulumi.String("West Europe"),
* })
* if err != nil {
* return err
* }
* exampleSqlServer, err := sql.NewSqlServer(ctx, "example", &sql.SqlServerArgs{
* Name: pulumi.String("mysqlserver"),
* 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
* }
* exampleAccount, err := storage.NewAccount(ctx, "example", &storage.AccountArgs{
* Name: pulumi.String("accteststorageaccount"),
* ResourceGroupName: example.Name,
* Location: example.Location,
* AccountTier: pulumi.String("Standard"),
* AccountReplicationType: pulumi.String("GRS"),
* })
* if err != nil {
* return err
* }
* exampleContainer, err := storage.NewContainer(ctx, "example", &storage.ContainerArgs{
* Name: pulumi.String("accteststoragecontainer"),
* StorageAccountName: exampleAccount.Name,
* ContainerAccessType: pulumi.String("private"),
* })
* if err != nil {
* return err
* }
* exampleServerSecurityAlertPolicy, err := mssql.NewServerSecurityAlertPolicy(ctx, "example", &mssql.ServerSecurityAlertPolicyArgs{
* ResourceGroupName: example.Name,
* ServerName: exampleSqlServer.Name,
* State: pulumi.String("Enabled"),
* })
* if err != nil {
* return err
* }
* exampleDatabase, err := sql.NewDatabase(ctx, "example", &sql.DatabaseArgs{
* Name: pulumi.String("mysqldatabase"),
* ResourceGroupName: example.Name,
* ServerName: exampleSqlServer.Name,
* Location: example.Location,
* Edition: pulumi.String("Standard"),
* })
* if err != nil {
* return err
* }
* exampleServerVulnerabilityAssessment, err := mssql.NewServerVulnerabilityAssessment(ctx, "example", &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, "example", &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
* })
* }
* ```
* ```java
* package generated_program;
* import com.pulumi.Context;
* import com.pulumi.Pulumi;
* import com.pulumi.core.Output;
* import com.pulumi.azure.core.ResourceGroup;
* import com.pulumi.azure.core.ResourceGroupArgs;
* import com.pulumi.azure.sql.SqlServer;
* import com.pulumi.azure.sql.SqlServerArgs;
* import com.pulumi.azure.storage.Account;
* import com.pulumi.azure.storage.AccountArgs;
* import com.pulumi.azure.storage.Container;
* import com.pulumi.azure.storage.ContainerArgs;
* import com.pulumi.azure.mssql.ServerSecurityAlertPolicy;
* import com.pulumi.azure.mssql.ServerSecurityAlertPolicyArgs;
* import com.pulumi.azure.sql.Database;
* import com.pulumi.azure.sql.DatabaseArgs;
* import com.pulumi.azure.mssql.ServerVulnerabilityAssessment;
* import com.pulumi.azure.mssql.ServerVulnerabilityAssessmentArgs;
* import com.pulumi.azure.mssql.DatabaseVulnerabilityAssessmentRuleBaseline;
* import com.pulumi.azure.mssql.DatabaseVulnerabilityAssessmentRuleBaselineArgs;
* import com.pulumi.azure.mssql.inputs.DatabaseVulnerabilityAssessmentRuleBaselineBaselineResultArgs;
* 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 ResourceGroup("example", ResourceGroupArgs.builder()
* .name("example-resources")
* .location("West Europe")
* .build());
* var exampleSqlServer = new SqlServer("exampleSqlServer", SqlServerArgs.builder()
* .name("mysqlserver")
* .resourceGroupName(example.name())
* .location(example.location())
* .version("12.0")
* .administratorLogin("4dm1n157r470r")
* .administratorLoginPassword("4-v3ry-53cr37-p455w0rd")
* .build());
* var exampleAccount = new Account("exampleAccount", AccountArgs.builder()
* .name("accteststorageaccount")
* .resourceGroupName(example.name())
* .location(example.location())
* .accountTier("Standard")
* .accountReplicationType("GRS")
* .build());
* var exampleContainer = new Container("exampleContainer", ContainerArgs.builder()
* .name("accteststoragecontainer")
* .storageAccountName(exampleAccount.name())
* .containerAccessType("private")
* .build());
* var exampleServerSecurityAlertPolicy = new ServerSecurityAlertPolicy("exampleServerSecurityAlertPolicy", ServerSecurityAlertPolicyArgs.builder()
* .resourceGroupName(example.name())
* .serverName(exampleSqlServer.name())
* .state("Enabled")
* .build());
* var exampleDatabase = new Database("exampleDatabase", DatabaseArgs.builder()
* .name("mysqldatabase")
* .resourceGroupName(example.name())
* .serverName(exampleSqlServer.name())
* .location(example.location())
* .edition("Standard")
* .build());
* var exampleServerVulnerabilityAssessment = new ServerVulnerabilityAssessment("exampleServerVulnerabilityAssessment", ServerVulnerabilityAssessmentArgs.builder()
* .serverSecurityAlertPolicyId(exampleServerSecurityAlertPolicy.id())
* .storageContainerPath(Output.tuple(exampleAccount.primaryBlobEndpoint(), exampleContainer.name()).applyValue(values -> {
* var primaryBlobEndpoint = values.t1;
* var name = values.t2;
* return String.format("%s%s/", primaryBlobEndpoint,name);
* }))
* .storageAccountAccessKey(exampleAccount.primaryAccessKey())
* .build());
* var exampleDatabaseVulnerabilityAssessmentRuleBaseline = new DatabaseVulnerabilityAssessmentRuleBaseline("exampleDatabaseVulnerabilityAssessmentRuleBaseline", DatabaseVulnerabilityAssessmentRuleBaselineArgs.builder()
* .serverVulnerabilityAssessmentId(exampleServerVulnerabilityAssessment.id())
* .databaseName(exampleDatabase.name())
* .ruleId("VA2065")
* .baselineName("master")
* .baselineResults(
* DatabaseVulnerabilityAssessmentRuleBaselineBaselineResultArgs.builder()
* .results(
* "allowedip1",
* "123.123.123.123",
* "123.123.123.123")
* .build(),
* DatabaseVulnerabilityAssessmentRuleBaselineBaselineResultArgs.builder()
* .results(
* "allowedip2",
* "255.255.255.255",
* "255.255.255.255")
* .build())
* .build());
* }
* }
* ```
* ```yaml
* resources:
* example:
* type: azure:core:ResourceGroup
* properties:
* name: example-resources
* location: West Europe
* exampleSqlServer:
* type: azure:sql:SqlServer
* name: example
* properties:
* name: mysqlserver
* resourceGroupName: ${example.name}
* location: ${example.location}
* version: '12.0'
* administratorLogin: 4dm1n157r470r
* administratorLoginPassword: 4-v3ry-53cr37-p455w0rd
* exampleAccount:
* type: azure:storage:Account
* name: example
* properties:
* name: accteststorageaccount
* resourceGroupName: ${example.name}
* location: ${example.location}
* accountTier: Standard
* accountReplicationType: GRS
* exampleContainer:
* type: azure:storage:Container
* name: example
* properties:
* name: accteststoragecontainer
* storageAccountName: ${exampleAccount.name}
* containerAccessType: private
* exampleServerSecurityAlertPolicy:
* type: azure:mssql:ServerSecurityAlertPolicy
* name: example
* properties:
* resourceGroupName: ${example.name}
* serverName: ${exampleSqlServer.name}
* state: Enabled
* exampleDatabase:
* type: azure:sql:Database
* name: example
* properties:
* name: mysqldatabase
* resourceGroupName: ${example.name}
* serverName: ${exampleSqlServer.name}
* location: ${example.location}
* edition: Standard
* exampleServerVulnerabilityAssessment:
* type: azure:mssql:ServerVulnerabilityAssessment
* name: example
* properties:
* serverSecurityAlertPolicyId: ${exampleServerSecurityAlertPolicy.id}
* storageContainerPath: ${exampleAccount.primaryBlobEndpoint}${exampleContainer.name}/
* storageAccountAccessKey: ${exampleAccount.primaryAccessKey}
* exampleDatabaseVulnerabilityAssessmentRuleBaseline:
* type: azure:mssql:DatabaseVulnerabilityAssessmentRuleBaseline
* name: example
* properties:
* 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.
* ```sh
* $ pulumi import azure:mssql/databaseVulnerabilityAssessmentRuleBaseline:DatabaseVulnerabilityAssessmentRuleBaseline example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/acceptanceTestResourceGroup1/providers/Microsoft.Sql/servers/mssqlserver/databases/mysqldatabase/vulnerabilityAssessments/Default/rules/VA2065/baselines/master
* ```
* @property baselineName The name of the vulnerability assessment rule baseline. Valid options are `default` and `master`. `default` implies a baseline on a database level rule and `master` for server level rule. Defaults to `default`. Changing this forces a new resource to be created.
* @property baselineResults A `baseline_result` block as documented below. Multiple blocks can be defined.
* @property databaseName Specifies the name of the MS SQL Database. Changing this forces a new resource to be created.
* @property ruleId The vulnerability assessment rule ID. Changing this forces a new resource to be created.
* @property serverVulnerabilityAssessmentId The Vulnerability Assessment ID of the MS SQL Server. Changing this forces a new resource to be created.
*/
public data class DatabaseVulnerabilityAssessmentRuleBaselineArgs(
public val baselineName: Output? = null,
public val baselineResults:
Output>? = null,
public val databaseName: Output? = null,
public val ruleId: Output? = null,
public val serverVulnerabilityAssessmentId: Output? = null,
) : ConvertibleToJava {
override fun toJava(): com.pulumi.azure.mssql.DatabaseVulnerabilityAssessmentRuleBaselineArgs =
com.pulumi.azure.mssql.DatabaseVulnerabilityAssessmentRuleBaselineArgs.builder()
.baselineName(baselineName?.applyValue({ args0 -> args0 }))
.baselineResults(
baselineResults?.applyValue({ args0 ->
args0.map({ args0 ->
args0.let({ args0 ->
args0.toJava()
})
})
}),
)
.databaseName(databaseName?.applyValue({ args0 -> args0 }))
.ruleId(ruleId?.applyValue({ args0 -> args0 }))
.serverVulnerabilityAssessmentId(
serverVulnerabilityAssessmentId?.applyValue({ args0 ->
args0
}),
).build()
}
/**
* Builder for [DatabaseVulnerabilityAssessmentRuleBaselineArgs].
*/
@PulumiTagMarker
public class DatabaseVulnerabilityAssessmentRuleBaselineArgsBuilder internal constructor() {
private var baselineName: Output? = null
private var baselineResults:
Output>? = null
private var databaseName: Output? = null
private var ruleId: Output? = null
private var serverVulnerabilityAssessmentId: Output? = null
/**
* @param value The name of the vulnerability assessment rule baseline. Valid options are `default` and `master`. `default` implies a baseline on a database level rule and `master` for server level rule. Defaults to `default`. Changing this forces a new resource to be created.
*/
@JvmName("mlrkkxeoiecntwxd")
public suspend fun baselineName(`value`: Output) {
this.baselineName = value
}
/**
* @param value A `baseline_result` block as documented below. Multiple blocks can be defined.
*/
@JvmName("vppnnjmsygatgpcn")
public suspend
fun baselineResults(`value`: Output>) {
this.baselineResults = value
}
@JvmName("vkwqjcfbxysjoneq")
public suspend fun baselineResults(
vararg
values: Output,
) {
this.baselineResults = Output.all(values.asList())
}
/**
* @param values A `baseline_result` block as documented below. Multiple blocks can be defined.
*/
@JvmName("jktvywfnacgcmphd")
public suspend
fun baselineResults(values: List
© 2015 - 2025 Weber Informatics LLC | Privacy Policy