azure-native.sql.ManagedDatabaseVulnerabilityAssessmentRuleBaseline
Explore with Pulumi AI
A database vulnerability assessment rule baseline. Azure REST API version: 2021-11-01. Prior API version in Azure Native 1.x: 2020-11-01-preview.
Other available API versions: 2022-11-01-preview, 2023-02-01-preview, 2023-05-01-preview, 2023-08-01-preview, 2024-05-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 managedDatabaseVulnerabilityAssessmentRuleBaseline = new AzureNative.Sql.ManagedDatabaseVulnerabilityAssessmentRuleBaseline("managedDatabaseVulnerabilityAssessmentRuleBaseline", 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",
ManagedInstanceName = "vulnerabilityaseessmenttest-6440",
ResourceGroupName = "vulnerabilityaseessmenttest-4799",
RuleId = "VA1001",
VulnerabilityAssessmentName = "default",
});
});
package main
import (
sql "github.com/pulumi/pulumi-azure-native-sdk/sql/v2"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := sql.NewManagedDatabaseVulnerabilityAssessmentRuleBaseline(ctx, "managedDatabaseVulnerabilityAssessmentRuleBaseline", &sql.ManagedDatabaseVulnerabilityAssessmentRuleBaselineArgs{
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"),
ManagedInstanceName: pulumi.String("vulnerabilityaseessmenttest-6440"),
ResourceGroupName: pulumi.String("vulnerabilityaseessmenttest-4799"),
RuleId: pulumi.String("VA1001"),
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.ManagedDatabaseVulnerabilityAssessmentRuleBaseline;
import com.pulumi.azurenative.sql.ManagedDatabaseVulnerabilityAssessmentRuleBaselineArgs;
import com.pulumi.azurenative.sql.inputs.DatabaseVulnerabilityAssessmentRuleBaselineItemArgs;
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 managedDatabaseVulnerabilityAssessmentRuleBaseline = new ManagedDatabaseVulnerabilityAssessmentRuleBaseline("managedDatabaseVulnerabilityAssessmentRuleBaseline", ManagedDatabaseVulnerabilityAssessmentRuleBaselineArgs.builder()
.baselineName("default")
.baselineResults(
DatabaseVulnerabilityAssessmentRuleBaselineItemArgs.builder()
.result(
"userA",
"SELECT")
.build(),
DatabaseVulnerabilityAssessmentRuleBaselineItemArgs.builder()
.result(
"userB",
"SELECT")
.build(),
DatabaseVulnerabilityAssessmentRuleBaselineItemArgs.builder()
.result(
"userC",
"SELECT",
"tableId_4")
.build())
.databaseName("testdb")
.managedInstanceName("vulnerabilityaseessmenttest-6440")
.resourceGroupName("vulnerabilityaseessmenttest-4799")
.ruleId("VA1001")
.vulnerabilityAssessmentName("default")
.build());
}
}
import pulumi
import pulumi_azure_native as azure_native
managed_database_vulnerability_assessment_rule_baseline = azure_native.sql.ManagedDatabaseVulnerabilityAssessmentRuleBaseline("managedDatabaseVulnerabilityAssessmentRuleBaseline",
baseline_name="default",
baseline_results=[
{
"result": [
"userA",
"SELECT",
],
},
{
"result": [
"userB",
"SELECT",
],
},
{
"result": [
"userC",
"SELECT",
"tableId_4",
],
},
],
database_name="testdb",
managed_instance_name="vulnerabilityaseessmenttest-6440",
resource_group_name="vulnerabilityaseessmenttest-4799",
rule_id="VA1001",
vulnerability_assessment_name="default")
import * as pulumi from "@pulumi/pulumi";
import * as azure_native from "@pulumi/azure-native";
const managedDatabaseVulnerabilityAssessmentRuleBaseline = new azure_native.sql.ManagedDatabaseVulnerabilityAssessmentRuleBaseline("managedDatabaseVulnerabilityAssessmentRuleBaseline", {
baselineName: "default",
baselineResults: [
{
result: [
"userA",
"SELECT",
],
},
{
result: [
"userB",
"SELECT",
],
},
{
result: [
"userC",
"SELECT",
"tableId_4",
],
},
],
databaseName: "testdb",
managedInstanceName: "vulnerabilityaseessmenttest-6440",
resourceGroupName: "vulnerabilityaseessmenttest-4799",
ruleId: "VA1001",
vulnerabilityAssessmentName: "default",
});
resources:
managedDatabaseVulnerabilityAssessmentRuleBaseline:
type: azure-native:sql:ManagedDatabaseVulnerabilityAssessmentRuleBaseline
properties:
baselineName: default
baselineResults:
- result:
- userA
- SELECT
- result:
- userB
- SELECT
- result:
- userC
- SELECT
- tableId_4
databaseName: testdb
managedInstanceName: vulnerabilityaseessmenttest-6440
resourceGroupName: vulnerabilityaseessmenttest-4799
ruleId: VA1001
vulnerabilityAssessmentName: default
Create ManagedDatabaseVulnerabilityAssessmentRuleBaseline Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new ManagedDatabaseVulnerabilityAssessmentRuleBaseline(name: string, args: ManagedDatabaseVulnerabilityAssessmentRuleBaselineArgs, opts?: CustomResourceOptions);
@overload
def ManagedDatabaseVulnerabilityAssessmentRuleBaseline(resource_name: str,
args: ManagedDatabaseVulnerabilityAssessmentRuleBaselineArgs,
opts: Optional[ResourceOptions] = None)
@overload
def ManagedDatabaseVulnerabilityAssessmentRuleBaseline(resource_name: str,
opts: Optional[ResourceOptions] = None,
baseline_results: Optional[Sequence[DatabaseVulnerabilityAssessmentRuleBaselineItemArgs]] = None,
database_name: Optional[str] = None,
managed_instance_name: Optional[str] = None,
resource_group_name: Optional[str] = None,
rule_id: Optional[str] = None,
vulnerability_assessment_name: Optional[str] = None,
baseline_name: Optional[str] = None)
func NewManagedDatabaseVulnerabilityAssessmentRuleBaseline(ctx *Context, name string, args ManagedDatabaseVulnerabilityAssessmentRuleBaselineArgs, opts ...ResourceOption) (*ManagedDatabaseVulnerabilityAssessmentRuleBaseline, error)
public ManagedDatabaseVulnerabilityAssessmentRuleBaseline(string name, ManagedDatabaseVulnerabilityAssessmentRuleBaselineArgs args, CustomResourceOptions? opts = null)
public ManagedDatabaseVulnerabilityAssessmentRuleBaseline(String name, ManagedDatabaseVulnerabilityAssessmentRuleBaselineArgs args)
public ManagedDatabaseVulnerabilityAssessmentRuleBaseline(String name, ManagedDatabaseVulnerabilityAssessmentRuleBaselineArgs args, CustomResourceOptions options)
type: azure-native:sql:ManagedDatabaseVulnerabilityAssessmentRuleBaseline
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 ManagedDatabaseVulnerabilityAssessmentRuleBaselineArgs
- 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 ManagedDatabaseVulnerabilityAssessmentRuleBaselineArgs
- 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 ManagedDatabaseVulnerabilityAssessmentRuleBaselineArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args ManagedDatabaseVulnerabilityAssessmentRuleBaselineArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args ManagedDatabaseVulnerabilityAssessmentRuleBaselineArgs
- 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 managedDatabaseVulnerabilityAssessmentRuleBaselineResource = new AzureNative.Sql.ManagedDatabaseVulnerabilityAssessmentRuleBaseline("managedDatabaseVulnerabilityAssessmentRuleBaselineResource", new()
{
BaselineResults = new[]
{
new AzureNative.Sql.Inputs.DatabaseVulnerabilityAssessmentRuleBaselineItemArgs
{
Result = new[]
{
"string",
},
},
},
DatabaseName = "string",
ManagedInstanceName = "string",
ResourceGroupName = "string",
RuleId = "string",
VulnerabilityAssessmentName = "string",
BaselineName = "string",
});
example, err := sql.NewManagedDatabaseVulnerabilityAssessmentRuleBaseline(ctx, "managedDatabaseVulnerabilityAssessmentRuleBaselineResource", &sql.ManagedDatabaseVulnerabilityAssessmentRuleBaselineArgs{
BaselineResults: sql.DatabaseVulnerabilityAssessmentRuleBaselineItemArray{
&sql.DatabaseVulnerabilityAssessmentRuleBaselineItemArgs{
Result: pulumi.StringArray{
pulumi.String("string"),
},
},
},
DatabaseName: pulumi.String("string"),
ManagedInstanceName: pulumi.String("string"),
ResourceGroupName: pulumi.String("string"),
RuleId: pulumi.String("string"),
VulnerabilityAssessmentName: pulumi.String("string"),
BaselineName: pulumi.String("string"),
})
var managedDatabaseVulnerabilityAssessmentRuleBaselineResource = new ManagedDatabaseVulnerabilityAssessmentRuleBaseline("managedDatabaseVulnerabilityAssessmentRuleBaselineResource", ManagedDatabaseVulnerabilityAssessmentRuleBaselineArgs.builder()
.baselineResults(DatabaseVulnerabilityAssessmentRuleBaselineItemArgs.builder()
.result("string")
.build())
.databaseName("string")
.managedInstanceName("string")
.resourceGroupName("string")
.ruleId("string")
.vulnerabilityAssessmentName("string")
.baselineName("string")
.build());
managed_database_vulnerability_assessment_rule_baseline_resource = azure_native.sql.ManagedDatabaseVulnerabilityAssessmentRuleBaseline("managedDatabaseVulnerabilityAssessmentRuleBaselineResource",
baseline_results=[{
"result": ["string"],
}],
database_name="string",
managed_instance_name="string",
resource_group_name="string",
rule_id="string",
vulnerability_assessment_name="string",
baseline_name="string")
const managedDatabaseVulnerabilityAssessmentRuleBaselineResource = new azure_native.sql.ManagedDatabaseVulnerabilityAssessmentRuleBaseline("managedDatabaseVulnerabilityAssessmentRuleBaselineResource", {
baselineResults: [{
result: ["string"],
}],
databaseName: "string",
managedInstanceName: "string",
resourceGroupName: "string",
ruleId: "string",
vulnerabilityAssessmentName: "string",
baselineName: "string",
});
type: azure-native:sql:ManagedDatabaseVulnerabilityAssessmentRuleBaseline
properties:
baselineName: string
baselineResults:
- result:
- string
databaseName: string
managedInstanceName: string
resourceGroupName: string
ruleId: string
vulnerabilityAssessmentName: string
ManagedDatabaseVulnerabilityAssessmentRuleBaseline Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.
The ManagedDatabaseVulnerabilityAssessmentRuleBaseline 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.
- Managed
Instance stringName - The name of the managed instance.
- 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.
- 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.
- Managed
Instance stringName - The name of the managed instance.
- 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.
- 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.
- managed
Instance StringName - The name of the managed instance.
- 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.
- 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.
- managed
Instance stringName - The name of the managed instance.
- 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.
- 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.
- managed_
instance_ strname - The name of the managed instance.
- 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.
- 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.
- managed
Instance StringName - The name of the managed instance.
- 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.
- 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 ManagedDatabaseVulnerabilityAssessmentRuleBaseline 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:ManagedDatabaseVulnerabilityAssessmentRuleBaseline default /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}/rules/{ruleId}/baselines/{baselineName}
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- Azure Native pulumi/pulumi-azure-native
- License
- Apache-2.0