1. Packages
  2. Sonarqube Provider
  3. API Docs
  4. QualityprofileDeactivateRule
Viewing docs for sonarqube 0.16.19
published on Friday, Mar 20, 2026 by jdamata
sonarqube logo
Viewing docs for sonarqube 0.16.19
published on Friday, Mar 20, 2026 by jdamata

    Provides a Sonarqube Rules resource. This can be used to deactivate Sonarqube rules on a quality profile.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as sonarqube from "@pulumi/sonarqube";
    
    const allowedMavenDependencies = new sonarqube.Rule("allowed_maven_dependencies", {
        customKey: "Only_use_allowed_Maven_dependencies",
        markdownDescription: "Description",
        name: "Only use allowed Maven dependencies",
        params: "FilePattern=**/pom.xml",
        severity: "BLOCKER",
        status: "READY",
        templateKey: "xml:XPathCheck",
        type: "VULNERABILITY",
    });
    const xml = new sonarqube.Qualityprofile("xml", {
        name: "test way - xml",
        language: "xml",
        isDefault: false,
        parent: "Sonar way",
    });
    const xmlRule = new sonarqube.QualityprofileDeactivateRule("xml_rule", {
        key: xml.key,
        rule: allowedMavenDependencies.ruleId,
    });
    
    import pulumi
    import pulumi_sonarqube as sonarqube
    
    allowed_maven_dependencies = sonarqube.Rule("allowed_maven_dependencies",
        custom_key="Only_use_allowed_Maven_dependencies",
        markdown_description="Description",
        name="Only use allowed Maven dependencies",
        params="FilePattern=**/pom.xml",
        severity="BLOCKER",
        status="READY",
        template_key="xml:XPathCheck",
        type="VULNERABILITY")
    xml = sonarqube.Qualityprofile("xml",
        name="test way - xml",
        language="xml",
        is_default=False,
        parent="Sonar way")
    xml_rule = sonarqube.QualityprofileDeactivateRule("xml_rule",
        key=xml.key,
        rule=allowed_maven_dependencies.rule_id)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-terraform-provider/sdks/go/sonarqube/sonarqube"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		allowedMavenDependencies, err := sonarqube.NewRule(ctx, "allowed_maven_dependencies", &sonarqube.RuleArgs{
    			CustomKey:           pulumi.String("Only_use_allowed_Maven_dependencies"),
    			MarkdownDescription: pulumi.String("Description"),
    			Name:                pulumi.String("Only use allowed Maven dependencies"),
    			Params:              pulumi.String("FilePattern=**/pom.xml"),
    			Severity:            pulumi.String("BLOCKER"),
    			Status:              pulumi.String("READY"),
    			TemplateKey:         pulumi.String("xml:XPathCheck"),
    			Type:                pulumi.String("VULNERABILITY"),
    		})
    		if err != nil {
    			return err
    		}
    		xml, err := sonarqube.NewQualityprofile(ctx, "xml", &sonarqube.QualityprofileArgs{
    			Name:      pulumi.String("test way - xml"),
    			Language:  pulumi.String("xml"),
    			IsDefault: pulumi.Bool(false),
    			Parent:    pulumi.String("Sonar way"),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = sonarqube.NewQualityprofileDeactivateRule(ctx, "xml_rule", &sonarqube.QualityprofileDeactivateRuleArgs{
    			Key:  xml.Key,
    			Rule: allowedMavenDependencies.RuleId,
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Sonarqube = Pulumi.Sonarqube;
    
    return await Deployment.RunAsync(() => 
    {
        var allowedMavenDependencies = new Sonarqube.Rule("allowed_maven_dependencies", new()
        {
            CustomKey = "Only_use_allowed_Maven_dependencies",
            MarkdownDescription = "Description",
            Name = "Only use allowed Maven dependencies",
            Params = "FilePattern=**/pom.xml",
            Severity = "BLOCKER",
            Status = "READY",
            TemplateKey = "xml:XPathCheck",
            Type = "VULNERABILITY",
        });
    
        var xml = new Sonarqube.Qualityprofile("xml", new()
        {
            Name = "test way - xml",
            Language = "xml",
            IsDefault = false,
            Parent = "Sonar way",
        });
    
        var xmlRule = new Sonarqube.QualityprofileDeactivateRule("xml_rule", new()
        {
            Key = xml.Key,
            Rule = allowedMavenDependencies.RuleId,
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.sonarqube.Rule;
    import com.pulumi.sonarqube.RuleArgs;
    import com.pulumi.sonarqube.Qualityprofile;
    import com.pulumi.sonarqube.QualityprofileArgs;
    import com.pulumi.sonarqube.QualityprofileDeactivateRule;
    import com.pulumi.sonarqube.QualityprofileDeactivateRuleArgs;
    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 allowedMavenDependencies = new Rule("allowedMavenDependencies", RuleArgs.builder()
                .customKey("Only_use_allowed_Maven_dependencies")
                .markdownDescription("Description")
                .name("Only use allowed Maven dependencies")
                .params("FilePattern=**/pom.xml")
                .severity("BLOCKER")
                .status("READY")
                .templateKey("xml:XPathCheck")
                .type("VULNERABILITY")
                .build());
    
            var xml = new Qualityprofile("xml", QualityprofileArgs.builder()
                .name("test way - xml")
                .language("xml")
                .isDefault(false)
                .parent("Sonar way")
                .build());
    
            var xmlRule = new QualityprofileDeactivateRule("xmlRule", QualityprofileDeactivateRuleArgs.builder()
                .key(xml.key())
                .rule(allowedMavenDependencies.ruleId())
                .build());
    
        }
    }
    
    resources:
      allowedMavenDependencies:
        type: sonarqube:Rule
        name: allowed_maven_dependencies
        properties:
          customKey: Only_use_allowed_Maven_dependencies
          markdownDescription: Description
          name: Only use allowed Maven dependencies
          params: FilePattern=**/pom.xml
          severity: BLOCKER
          status: READY
          templateKey: xml:XPathCheck
          type: VULNERABILITY
      xml:
        type: sonarqube:Qualityprofile
        properties:
          name: test way - xml
          language: xml
          isDefault: 'false'
          parent: Sonar way
      xmlRule:
        type: sonarqube:QualityprofileDeactivateRule
        name: xml_rule
        properties:
          key: ${xml.key}
          rule: ${allowedMavenDependencies.ruleId}
    

    Create QualityprofileDeactivateRule Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new QualityprofileDeactivateRule(name: string, args: QualityprofileDeactivateRuleArgs, opts?: CustomResourceOptions);
    @overload
    def QualityprofileDeactivateRule(resource_name: str,
                                     args: QualityprofileDeactivateRuleArgs,
                                     opts: Optional[ResourceOptions] = None)
    
    @overload
    def QualityprofileDeactivateRule(resource_name: str,
                                     opts: Optional[ResourceOptions] = None,
                                     key: Optional[str] = None,
                                     rule: Optional[str] = None,
                                     qualityprofile_deactivate_rule_id: Optional[str] = None)
    func NewQualityprofileDeactivateRule(ctx *Context, name string, args QualityprofileDeactivateRuleArgs, opts ...ResourceOption) (*QualityprofileDeactivateRule, error)
    public QualityprofileDeactivateRule(string name, QualityprofileDeactivateRuleArgs args, CustomResourceOptions? opts = null)
    public QualityprofileDeactivateRule(String name, QualityprofileDeactivateRuleArgs args)
    public QualityprofileDeactivateRule(String name, QualityprofileDeactivateRuleArgs args, CustomResourceOptions options)
    
    type: sonarqube:QualityprofileDeactivateRule
    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 QualityprofileDeactivateRuleArgs
    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 QualityprofileDeactivateRuleArgs
    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 QualityprofileDeactivateRuleArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args QualityprofileDeactivateRuleArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args QualityprofileDeactivateRuleArgs
    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 qualityprofileDeactivateRuleResource = new Sonarqube.QualityprofileDeactivateRule("qualityprofileDeactivateRuleResource", new()
    {
        Key = "string",
        Rule = "string",
        QualityprofileDeactivateRuleId = "string",
    });
    
    example, err := sonarqube.NewQualityprofileDeactivateRule(ctx, "qualityprofileDeactivateRuleResource", &sonarqube.QualityprofileDeactivateRuleArgs{
    	Key:                            pulumi.String("string"),
    	Rule:                           pulumi.String("string"),
    	QualityprofileDeactivateRuleId: pulumi.String("string"),
    })
    
    var qualityprofileDeactivateRuleResource = new QualityprofileDeactivateRule("qualityprofileDeactivateRuleResource", QualityprofileDeactivateRuleArgs.builder()
        .key("string")
        .rule("string")
        .qualityprofileDeactivateRuleId("string")
        .build());
    
    qualityprofile_deactivate_rule_resource = sonarqube.QualityprofileDeactivateRule("qualityprofileDeactivateRuleResource",
        key="string",
        rule="string",
        qualityprofile_deactivate_rule_id="string")
    
    const qualityprofileDeactivateRuleResource = new sonarqube.QualityprofileDeactivateRule("qualityprofileDeactivateRuleResource", {
        key: "string",
        rule: "string",
        qualityprofileDeactivateRuleId: "string",
    });
    
    type: sonarqube:QualityprofileDeactivateRule
    properties:
        key: string
        qualityprofileDeactivateRuleId: string
        rule: string
    

    QualityprofileDeactivateRule 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 QualityprofileDeactivateRule resource accepts the following input properties:

    Key string
    Quality Profile key. Can be obtained through api/qualityprofiles/search
    Rule string
    Rule key
    QualityprofileDeactivateRuleId string
    The ID of this resource.
    Key string
    Quality Profile key. Can be obtained through api/qualityprofiles/search
    Rule string
    Rule key
    QualityprofileDeactivateRuleId string
    The ID of this resource.
    key String
    Quality Profile key. Can be obtained through api/qualityprofiles/search
    rule String
    Rule key
    qualityprofileDeactivateRuleId String
    The ID of this resource.
    key string
    Quality Profile key. Can be obtained through api/qualityprofiles/search
    rule string
    Rule key
    qualityprofileDeactivateRuleId string
    The ID of this resource.
    key str
    Quality Profile key. Can be obtained through api/qualityprofiles/search
    rule str
    Rule key
    qualityprofile_deactivate_rule_id str
    The ID of this resource.
    key String
    Quality Profile key. Can be obtained through api/qualityprofiles/search
    rule String
    Rule key
    qualityprofileDeactivateRuleId String
    The ID of this resource.

    Outputs

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

    Id string
    The provider-assigned unique ID for this managed resource.
    Id string
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.
    id string
    The provider-assigned unique ID for this managed resource.
    id str
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.

    Look up Existing QualityprofileDeactivateRule Resource

    Get an existing QualityprofileDeactivateRule resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

    public static get(name: string, id: Input<ID>, state?: QualityprofileDeactivateRuleState, opts?: CustomResourceOptions): QualityprofileDeactivateRule
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            key: Optional[str] = None,
            qualityprofile_deactivate_rule_id: Optional[str] = None,
            rule: Optional[str] = None) -> QualityprofileDeactivateRule
    func GetQualityprofileDeactivateRule(ctx *Context, name string, id IDInput, state *QualityprofileDeactivateRuleState, opts ...ResourceOption) (*QualityprofileDeactivateRule, error)
    public static QualityprofileDeactivateRule Get(string name, Input<string> id, QualityprofileDeactivateRuleState? state, CustomResourceOptions? opts = null)
    public static QualityprofileDeactivateRule get(String name, Output<String> id, QualityprofileDeactivateRuleState state, CustomResourceOptions options)
    resources:  _:    type: sonarqube:QualityprofileDeactivateRule    get:      id: ${id}
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    resource_name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    The following state arguments are supported:
    Key string
    Quality Profile key. Can be obtained through api/qualityprofiles/search
    QualityprofileDeactivateRuleId string
    The ID of this resource.
    Rule string
    Rule key
    Key string
    Quality Profile key. Can be obtained through api/qualityprofiles/search
    QualityprofileDeactivateRuleId string
    The ID of this resource.
    Rule string
    Rule key
    key String
    Quality Profile key. Can be obtained through api/qualityprofiles/search
    qualityprofileDeactivateRuleId String
    The ID of this resource.
    rule String
    Rule key
    key string
    Quality Profile key. Can be obtained through api/qualityprofiles/search
    qualityprofileDeactivateRuleId string
    The ID of this resource.
    rule string
    Rule key
    key str
    Quality Profile key. Can be obtained through api/qualityprofiles/search
    qualityprofile_deactivate_rule_id str
    The ID of this resource.
    rule str
    Rule key
    key String
    Quality Profile key. Can be obtained through api/qualityprofiles/search
    qualityprofileDeactivateRuleId String
    The ID of this resource.
    rule String
    Rule key

    Package Details

    Repository
    sonarqube jdamata/terraform-provider-sonarqube
    License
    Notes
    This Pulumi package is based on the sonarqube Terraform Provider.
    sonarqube logo
    Viewing docs for sonarqube 0.16.19
    published on Friday, Mar 20, 2026 by jdamata
      Try Pulumi Cloud free. Your team will thank you.