DatabaseVulnerabilityAssessmentRuleBaseline

A database vulnerability assessment rule baseline. API Version: 2020-11-01-preview.

Example Usage

Creates or updates a database's vulnerability assessment rule baseline.

using System.Collections.Generic;
using Pulumi;
using AzureNative = Pulumi.AzureNative;

return await Deployment.RunAsync(() => 
{
    var databaseVulnerabilityAssessmentRuleBaseline = new AzureNative.Sql.DatabaseVulnerabilityAssessmentRuleBaseline("databaseVulnerabilityAssessmentRuleBaseline", new()
    {
        BaselineName = "default",
        BaselineResults = new[]
        {
            new AzureNative.Sql.Inputs.DatabaseVulnerabilityAssessmentRuleBaselineItemArgs
            {
                Result = new[]
                {
                    "userA",
                    "SELECT",
                },
            },
            new AzureNative.Sql.Inputs.DatabaseVulnerabilityAssessmentRuleBaselineItemArgs
            {
                Result = new[]
                {
                    "userB",
                    "SELECT",
                },
            },
            new AzureNative.Sql.Inputs.DatabaseVulnerabilityAssessmentRuleBaselineItemArgs
            {
                Result = new[]
                {
                    "userC",
                    "SELECT",
                    "tableId_4",
                },
            },
        },
        DatabaseName = "testdb",
        ResourceGroupName = "vulnerabilityaseessmenttest-4799",
        RuleId = "VA1001",
        ServerName = "vulnerabilityaseessmenttest-6440",
        VulnerabilityAssessmentName = "default",
    });

});
package main

import (
	sql "github.com/pulumi/pulumi-azure-native/sdk/go/azure/sql"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := sql.NewDatabaseVulnerabilityAssessmentRuleBaseline(ctx, "databaseVulnerabilityAssessmentRuleBaseline", &sql.DatabaseVulnerabilityAssessmentRuleBaselineArgs{
			BaselineName: pulumi.String("default"),
			BaselineResults: sql.DatabaseVulnerabilityAssessmentRuleBaselineItemArray{
				&sql.DatabaseVulnerabilityAssessmentRuleBaselineItemArgs{
					Result: pulumi.StringArray{
						pulumi.String("userA"),
						pulumi.String("SELECT"),
					},
				},
				&sql.DatabaseVulnerabilityAssessmentRuleBaselineItemArgs{
					Result: pulumi.StringArray{
						pulumi.String("userB"),
						pulumi.String("SELECT"),
					},
				},
				&sql.DatabaseVulnerabilityAssessmentRuleBaselineItemArgs{
					Result: pulumi.StringArray{
						pulumi.String("userC"),
						pulumi.String("SELECT"),
						pulumi.String("tableId_4"),
					},
				},
			},
			DatabaseName:                pulumi.String("testdb"),
			ResourceGroupName:           pulumi.String("vulnerabilityaseessmenttest-4799"),
			RuleId:                      pulumi.String("VA1001"),
			ServerName:                  pulumi.String("vulnerabilityaseessmenttest-6440"),
			VulnerabilityAssessmentName: pulumi.String("default"),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azurenative.sql.DatabaseVulnerabilityAssessmentRuleBaseline;
import com.pulumi.azurenative.sql.DatabaseVulnerabilityAssessmentRuleBaselineArgs;
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 databaseVulnerabilityAssessmentRuleBaseline = new DatabaseVulnerabilityAssessmentRuleBaseline("databaseVulnerabilityAssessmentRuleBaseline", DatabaseVulnerabilityAssessmentRuleBaselineArgs.builder()        
            .baselineName("default")
            .baselineResults(            
                Map.of("result",                 
                    "userA",
                    "SELECT"),
                Map.of("result",                 
                    "userB",
                    "SELECT"),
                Map.of("result",                 
                    "userC",
                    "SELECT",
                    "tableId_4"))
            .databaseName("testdb")
            .resourceGroupName("vulnerabilityaseessmenttest-4799")
            .ruleId("VA1001")
            .serverName("vulnerabilityaseessmenttest-6440")
            .vulnerabilityAssessmentName("default")
            .build());

    }
}
import pulumi
import pulumi_azure_native as azure_native

database_vulnerability_assessment_rule_baseline = azure_native.sql.DatabaseVulnerabilityAssessmentRuleBaseline("databaseVulnerabilityAssessmentRuleBaseline",
    baseline_name="default",
    baseline_results=[
        azure_native.sql.DatabaseVulnerabilityAssessmentRuleBaselineItemArgs(
            result=[
                "userA",
                "SELECT",
            ],
        ),
        azure_native.sql.DatabaseVulnerabilityAssessmentRuleBaselineItemArgs(
            result=[
                "userB",
                "SELECT",
            ],
        ),
        azure_native.sql.DatabaseVulnerabilityAssessmentRuleBaselineItemArgs(
            result=[
                "userC",
                "SELECT",
                "tableId_4",
            ],
        ),
    ],
    database_name="testdb",
    resource_group_name="vulnerabilityaseessmenttest-4799",
    rule_id="VA1001",
    server_name="vulnerabilityaseessmenttest-6440",
    vulnerability_assessment_name="default")
import * as pulumi from "@pulumi/pulumi";
import * as azure_native from "@pulumi/azure-native";

const databaseVulnerabilityAssessmentRuleBaseline = new azure_native.sql.DatabaseVulnerabilityAssessmentRuleBaseline("databaseVulnerabilityAssessmentRuleBaseline", {
    baselineName: "default",
    baselineResults: [
        {
            result: [
                "userA",
                "SELECT",
            ],
        },
        {
            result: [
                "userB",
                "SELECT",
            ],
        },
        {
            result: [
                "userC",
                "SELECT",
                "tableId_4",
            ],
        },
    ],
    databaseName: "testdb",
    resourceGroupName: "vulnerabilityaseessmenttest-4799",
    ruleId: "VA1001",
    serverName: "vulnerabilityaseessmenttest-6440",
    vulnerabilityAssessmentName: "default",
});
resources:
  databaseVulnerabilityAssessmentRuleBaseline:
    type: azure-native:sql:DatabaseVulnerabilityAssessmentRuleBaseline
    properties:
      baselineName: default
      baselineResults:
        - result:
            - userA
            - SELECT
        - result:
            - userB
            - SELECT
        - result:
            - userC
            - SELECT
            - tableId_4
      databaseName: testdb
      resourceGroupName: vulnerabilityaseessmenttest-4799
      ruleId: VA1001
      serverName: vulnerabilityaseessmenttest-6440
      vulnerabilityAssessmentName: default

Create DatabaseVulnerabilityAssessmentRuleBaseline Resource

new DatabaseVulnerabilityAssessmentRuleBaseline(name: string, args: DatabaseVulnerabilityAssessmentRuleBaselineArgs, opts?: CustomResourceOptions);
@overload
def DatabaseVulnerabilityAssessmentRuleBaseline(resource_name: str,
                                                opts: Optional[ResourceOptions] = None,
                                                baseline_name: Optional[str] = None,
                                                baseline_results: Optional[Sequence[DatabaseVulnerabilityAssessmentRuleBaselineItemArgs]] = None,
                                                database_name: Optional[str] = None,
                                                resource_group_name: Optional[str] = None,
                                                rule_id: Optional[str] = None,
                                                server_name: Optional[str] = None,
                                                vulnerability_assessment_name: Optional[str] = None)
@overload
def DatabaseVulnerabilityAssessmentRuleBaseline(resource_name: str,
                                                args: DatabaseVulnerabilityAssessmentRuleBaselineArgs,
                                                opts: Optional[ResourceOptions] = None)
func NewDatabaseVulnerabilityAssessmentRuleBaseline(ctx *Context, name string, args DatabaseVulnerabilityAssessmentRuleBaselineArgs, opts ...ResourceOption) (*DatabaseVulnerabilityAssessmentRuleBaseline, error)
public DatabaseVulnerabilityAssessmentRuleBaseline(string name, DatabaseVulnerabilityAssessmentRuleBaselineArgs args, CustomResourceOptions? opts = null)
public DatabaseVulnerabilityAssessmentRuleBaseline(String name, DatabaseVulnerabilityAssessmentRuleBaselineArgs args)
public DatabaseVulnerabilityAssessmentRuleBaseline(String name, DatabaseVulnerabilityAssessmentRuleBaselineArgs args, CustomResourceOptions options)
type: azure-native:sql:DatabaseVulnerabilityAssessmentRuleBaseline
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

name string
The unique name of the resource.
args DatabaseVulnerabilityAssessmentRuleBaselineArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name str
The unique name of the resource.
args DatabaseVulnerabilityAssessmentRuleBaselineArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name string
The unique name of the resource.
args DatabaseVulnerabilityAssessmentRuleBaselineArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args DatabaseVulnerabilityAssessmentRuleBaselineArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name String
The unique name of the resource.
args DatabaseVulnerabilityAssessmentRuleBaselineArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

DatabaseVulnerabilityAssessmentRuleBaseline Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

Inputs

The DatabaseVulnerabilityAssessmentRuleBaseline resource accepts the following input properties:

BaselineResults List<Pulumi.AzureNative.Sql.Inputs.DatabaseVulnerabilityAssessmentRuleBaselineItemArgs>

The rule baseline result

DatabaseName string

The name of the database for which the vulnerability assessment rule baseline is defined.

ResourceGroupName string

The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.

RuleId string

The vulnerability assessment rule ID.

ServerName string

The name of the server.

VulnerabilityAssessmentName string

The name of the vulnerability assessment.

BaselineName string

The name of the vulnerability assessment rule baseline (default implies a baseline on a database level rule and master for server level rule).

BaselineResults []DatabaseVulnerabilityAssessmentRuleBaselineItemArgs

The rule baseline result

DatabaseName string

The name of the database for which the vulnerability assessment rule baseline is defined.

ResourceGroupName string

The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.

RuleId string

The vulnerability assessment rule ID.

ServerName string

The name of the server.

VulnerabilityAssessmentName string

The name of the vulnerability assessment.

BaselineName string

The name of the vulnerability assessment rule baseline (default implies a baseline on a database level rule and master for server level rule).

baselineResults List<DatabaseVulnerabilityAssessmentRuleBaselineItemArgs>

The rule baseline result

databaseName String

The name of the database for which the vulnerability assessment rule baseline is defined.

resourceGroupName String

The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.

ruleId String

The vulnerability assessment rule ID.

serverName String

The name of the server.

vulnerabilityAssessmentName String

The name of the vulnerability assessment.

baselineName String

The name of the vulnerability assessment rule baseline (default implies a baseline on a database level rule and master for server level rule).

baselineResults DatabaseVulnerabilityAssessmentRuleBaselineItemArgs[]

The rule baseline result

databaseName string

The name of the database for which the vulnerability assessment rule baseline is defined.

resourceGroupName string

The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.

ruleId string

The vulnerability assessment rule ID.

serverName string

The name of the server.

vulnerabilityAssessmentName string

The name of the vulnerability assessment.

baselineName string

The name of the vulnerability assessment rule baseline (default implies a baseline on a database level rule and master for server level rule).

baseline_results Sequence[DatabaseVulnerabilityAssessmentRuleBaselineItemArgs]

The rule baseline result

database_name str

The name of the database for which the vulnerability assessment rule baseline is defined.

resource_group_name str

The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.

rule_id str

The vulnerability assessment rule ID.

server_name str

The name of the server.

vulnerability_assessment_name str

The name of the vulnerability assessment.

baseline_name str

The name of the vulnerability assessment rule baseline (default implies a baseline on a database level rule and master for server level rule).

baselineResults List<Property Map>

The rule baseline result

databaseName String

The name of the database for which the vulnerability assessment rule baseline is defined.

resourceGroupName String

The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.

ruleId String

The vulnerability assessment rule ID.

serverName String

The name of the server.

vulnerabilityAssessmentName String

The name of the vulnerability assessment.

baselineName String

The name of the vulnerability assessment rule baseline (default implies a baseline on a database level rule and master for server level rule).

Outputs

All input properties are implicitly available as output properties. Additionally, the DatabaseVulnerabilityAssessmentRuleBaseline resource produces the following output properties:

Id string

The provider-assigned unique ID for this managed resource.

Name string

Resource name.

Type string

Resource type.

Id string

The provider-assigned unique ID for this managed resource.

Name string

Resource name.

Type string

Resource type.

id String

The provider-assigned unique ID for this managed resource.

name String

Resource name.

type String

Resource type.

id string

The provider-assigned unique ID for this managed resource.

name string

Resource name.

type string

Resource type.

id str

The provider-assigned unique ID for this managed resource.

name str

Resource name.

type str

Resource type.

id String

The provider-assigned unique ID for this managed resource.

name String

Resource name.

type String

Resource type.

Supporting Types

DatabaseVulnerabilityAssessmentRuleBaselineItem

Result List<string>

The rule baseline result

Result []string

The rule baseline result

result List<String>

The rule baseline result

result string[]

The rule baseline result

result Sequence[str]

The rule baseline result

result List<String>

The rule baseline result

DatabaseVulnerabilityAssessmentRuleBaselineItemResponse

Result List<string>

The rule baseline result

Result []string

The rule baseline result

result List<String>

The rule baseline result

result string[]

The rule baseline result

result Sequence[str]

The rule baseline result

result List<String>

The rule baseline result

Import

An existing resource can be imported using its type token, name, and identifier, e.g.

$ pulumi import azure-native:sql:DatabaseVulnerabilityAssessmentRuleBaseline default /subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/vulnerabilityaseessmenttest-4799/providers/Microsoft.Sql/servers/vulnerabilityaseessmenttest-6440/databases/testdb/vulnerabilityAssessments/default/rules/VA1001/baselines/default 

Package Details

Repository
https://github.com/pulumi/pulumi-azure-native
License
Apache-2.0