azure-native.sql.DatabaseVulnerabilityAssessmentRuleBaseline
Explore with Pulumi AI
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 System.Linq;
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/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.DatabaseVulnerabilityAssessmentRuleBaselineItemArgs{
{
Result: pulumi.StringArray{
pulumi.String("userA"),
pulumi.String("SELECT"),
},
},
{
Result: pulumi.StringArray{
pulumi.String("userB"),
pulumi.String("SELECT"),
},
},
{
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
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new DatabaseVulnerabilityAssessmentRuleBaseline(name: string, args: DatabaseVulnerabilityAssessmentRuleBaselineArgs, opts?: CustomResourceOptions);
@overload
def DatabaseVulnerabilityAssessmentRuleBaseline(resource_name: str,
args: DatabaseVulnerabilityAssessmentRuleBaselineArgs,
opts: Optional[ResourceOptions] = None)
@overload
def DatabaseVulnerabilityAssessmentRuleBaseline(resource_name: str,
opts: Optional[ResourceOptions] = 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,
baseline_name: Optional[str] = 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.
Parameters
- 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.
Constructor example
The following reference example uses placeholder values for all input properties.
var databaseVulnerabilityAssessmentRuleBaselineResource = new AzureNative.Sql.DatabaseVulnerabilityAssessmentRuleBaseline("databaseVulnerabilityAssessmentRuleBaselineResource", new()
{
BaselineResults = new[]
{
{
{ "result", new[]
{
"string",
} },
},
},
DatabaseName = "string",
ResourceGroupName = "string",
RuleId = "string",
ServerName = "string",
VulnerabilityAssessmentName = "string",
BaselineName = "string",
});
example, err := sql.NewDatabaseVulnerabilityAssessmentRuleBaseline(ctx, "databaseVulnerabilityAssessmentRuleBaselineResource", &sql.DatabaseVulnerabilityAssessmentRuleBaselineArgs{
BaselineResults: []map[string]interface{}{
map[string]interface{}{
"result": []string{
"string",
},
},
},
DatabaseName: "string",
ResourceGroupName: "string",
RuleId: "string",
ServerName: "string",
VulnerabilityAssessmentName: "string",
BaselineName: "string",
})
var databaseVulnerabilityAssessmentRuleBaselineResource = new DatabaseVulnerabilityAssessmentRuleBaseline("databaseVulnerabilityAssessmentRuleBaselineResource", DatabaseVulnerabilityAssessmentRuleBaselineArgs.builder()
.baselineResults(%!v(PANIC=Format method: runtime error: invalid memory address or nil pointer dereference))
.databaseName("string")
.resourceGroupName("string")
.ruleId("string")
.serverName("string")
.vulnerabilityAssessmentName("string")
.baselineName("string")
.build());
database_vulnerability_assessment_rule_baseline_resource = azure_native.sql.DatabaseVulnerabilityAssessmentRuleBaseline("databaseVulnerabilityAssessmentRuleBaselineResource",
baseline_results=[{
result: [string],
}],
database_name=string,
resource_group_name=string,
rule_id=string,
server_name=string,
vulnerability_assessment_name=string,
baseline_name=string)
const databaseVulnerabilityAssessmentRuleBaselineResource = new azure_native.sql.DatabaseVulnerabilityAssessmentRuleBaseline("databaseVulnerabilityAssessmentRuleBaselineResource", {
baselineResults: [{
result: ["string"],
}],
databaseName: "string",
resourceGroupName: "string",
ruleId: "string",
serverName: "string",
vulnerabilityAssessmentName: "string",
baselineName: "string",
});
type: azure-native:sql:DatabaseVulnerabilityAssessmentRuleBaseline
properties:
baselineName: string
baselineResults:
- result:
- string
databaseName: string
resourceGroupName: string
ruleId: string
serverName: string
vulnerabilityAssessmentName: string
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:
- Baseline
Results List<Pulumi.Azure Native. Sql. Inputs. Database Vulnerability Assessment Rule Baseline Item> - The rule baseline result
- Database
Name string - The name of the database for which the vulnerability assessment rule baseline is defined.
- Resource
Group stringName - 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 string - The vulnerability assessment rule ID.
- Server
Name string - The name of the server.
- Vulnerability
Assessment stringName - The name of the vulnerability assessment.
- Baseline
Name 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 []DatabaseVulnerability Assessment Rule Baseline Item Args - The rule baseline result
- Database
Name string - The name of the database for which the vulnerability assessment rule baseline is defined.
- Resource
Group stringName - 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 string - The vulnerability assessment rule ID.
- Server
Name string - The name of the server.
- Vulnerability
Assessment stringName - The name of the vulnerability assessment.
- Baseline
Name 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 List<DatabaseVulnerability Assessment Rule Baseline Item> - The rule baseline result
- database
Name String - The name of the database for which the vulnerability assessment rule baseline is defined.
- resource
Group StringName - 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 String - The vulnerability assessment rule ID.
- server
Name String - The name of the server.
- vulnerability
Assessment StringName - The name of the vulnerability assessment.
- baseline
Name 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 DatabaseVulnerability Assessment Rule Baseline Item[] - The rule baseline result
- database
Name string - The name of the database for which the vulnerability assessment rule baseline is defined.
- resource
Group stringName - 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 string - The vulnerability assessment rule ID.
- server
Name string - The name of the server.
- vulnerability
Assessment stringName - The name of the vulnerability assessment.
- baseline
Name 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[DatabaseVulnerability Assessment Rule Baseline Item Args] - The rule baseline result
- database_
name str - The name of the database for which the vulnerability assessment rule baseline is defined.
- resource_
group_ strname - 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_ strname - 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).
- baseline
Results List<Property Map> - The rule baseline result
- database
Name String - The name of the database for which the vulnerability assessment rule baseline is defined.
- resource
Group StringName - 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 String - The vulnerability assessment rule ID.
- server
Name String - The name of the server.
- vulnerability
Assessment StringName - The name of the vulnerability assessment.
- baseline
Name 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:
Supporting Types
DatabaseVulnerabilityAssessmentRuleBaselineItem, DatabaseVulnerabilityAssessmentRuleBaselineItemArgs
- 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, DatabaseVulnerabilityAssessmentRuleBaselineItemResponseArgs
- 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
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- azure-native-v1 pulumi/pulumi-azure-native
- License
- Apache-2.0