1. Packages
  2. Azure Native
  3. API Docs
  4. sql
  5. DatabaseVulnerabilityAssessmentRuleBaseline
This is the latest version of Azure Native. Use the Azure Native v1 docs if using the v1 version of this package.
Azure Native v2.50.1 published on Tuesday, Jul 16, 2024 by Pulumi

azure-native.sql.DatabaseVulnerabilityAssessmentRuleBaseline

Explore with Pulumi AI

azure-native logo
This is the latest version of Azure Native. Use the Azure Native v1 docs if using the v1 version of this package.
Azure Native v2.50.1 published on Tuesday, Jul 16, 2024 by Pulumi

    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.

    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/v2"
    	"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 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 databaseVulnerabilityAssessmentRuleBaseline = new DatabaseVulnerabilityAssessmentRuleBaseline("databaseVulnerabilityAssessmentRuleBaseline", DatabaseVulnerabilityAssessmentRuleBaselineArgs.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")
                .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=[
            {
                "result": [
                    "userA",
                    "SELECT",
                ],
            },
            {
                "result": [
                    "userB",
                    "SELECT",
                ],
            },
            {
                "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[]
        {
            new AzureNative.Sql.Inputs.DatabaseVulnerabilityAssessmentRuleBaselineItemArgs
            {
                Result = new[]
                {
                    "string",
                },
            },
        },
        DatabaseName = "string",
        ResourceGroupName = "string",
        RuleId = "string",
        ServerName = "string",
        VulnerabilityAssessmentName = "string",
        BaselineName = "string",
    });
    
    example, err := sql.NewDatabaseVulnerabilityAssessmentRuleBaseline(ctx, "databaseVulnerabilityAssessmentRuleBaselineResource", &sql.DatabaseVulnerabilityAssessmentRuleBaselineArgs{
    	BaselineResults: sql.DatabaseVulnerabilityAssessmentRuleBaselineItemArray{
    		&sql.DatabaseVulnerabilityAssessmentRuleBaselineItemArgs{
    			Result: pulumi.StringArray{
    				pulumi.String("string"),
    			},
    		},
    	},
    	DatabaseName:                pulumi.String("string"),
    	ResourceGroupName:           pulumi.String("string"),
    	RuleId:                      pulumi.String("string"),
    	ServerName:                  pulumi.String("string"),
    	VulnerabilityAssessmentName: pulumi.String("string"),
    	BaselineName:                pulumi.String("string"),
    })
    
    var databaseVulnerabilityAssessmentRuleBaselineResource = new DatabaseVulnerabilityAssessmentRuleBaseline("databaseVulnerabilityAssessmentRuleBaselineResource", DatabaseVulnerabilityAssessmentRuleBaselineArgs.builder()
        .baselineResults(DatabaseVulnerabilityAssessmentRuleBaselineItemArgs.builder()
            .result("string")
            .build())
        .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:

    BaselineResults List<Pulumi.AzureNative.Sql.Inputs.DatabaseVulnerabilityAssessmentRuleBaselineItem>
    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<DatabaseVulnerabilityAssessmentRuleBaselineItem>
    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 DatabaseVulnerabilityAssessmentRuleBaselineItem[]
    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, 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/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/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
    azure-native logo
    This is the latest version of Azure Native. Use the Azure Native v1 docs if using the v1 version of this package.
    Azure Native v2.50.1 published on Tuesday, Jul 16, 2024 by Pulumi