1. Packages
  2. Sonarqube Provider
  3. API Docs
  4. Setting
sonarqube 0.16.14 published on Monday, Apr 14, 2025 by jdamata

sonarqube.Setting

Explore with Pulumi AI

sonarqube logo
sonarqube 0.16.14 published on Monday, Apr 14, 2025 by jdamata

    Provides a Sonarqube Settings resource. This can be used to manage Sonarqube settings.

    Example Usage

    Example: create a setting with multiple values

    import * as pulumi from "@pulumi/pulumi";
    import * as sonarqube from "@pulumi/sonarqube";
    
    const multiValueSetting = new sonarqube.Setting("multiValueSetting", {
        key: "sonar.global.exclusions",
        values: [
            "foo",
            "bar/**/*.*",
        ],
    });
    
    import pulumi
    import pulumi_sonarqube as sonarqube
    
    multi_value_setting = sonarqube.Setting("multiValueSetting",
        key="sonar.global.exclusions",
        values=[
            "foo",
            "bar/**/*.*",
        ])
    
    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 {
    		_, err := sonarqube.NewSetting(ctx, "multiValueSetting", &sonarqube.SettingArgs{
    			Key: pulumi.String("sonar.global.exclusions"),
    			Values: pulumi.StringArray{
    				pulumi.String("foo"),
    				pulumi.String("bar/**/*.*"),
    			},
    		})
    		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 multiValueSetting = new Sonarqube.Setting("multiValueSetting", new()
        {
            Key = "sonar.global.exclusions",
            Values = new[]
            {
                "foo",
                "bar/**/*.*",
            },
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.sonarqube.Setting;
    import com.pulumi.sonarqube.SettingArgs;
    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 multiValueSetting = new Setting("multiValueSetting", SettingArgs.builder()
                .key("sonar.global.exclusions")
                .values(            
                    "foo",
                    "bar/**/*.*")
                .build());
    
        }
    }
    
    resources:
      multiValueSetting:
        type: sonarqube:Setting
        properties:
          key: sonar.global.exclusions
          values:
            - foo
            - bar/**/*.*
    

    Example: create a setting with multiple field values

    import * as pulumi from "@pulumi/pulumi";
    import * as sonarqube from "@pulumi/sonarqube";
    
    const multiFieldSetting = new sonarqube.Setting("multiFieldSetting", {
        key: "sonar.issue.ignore.multicriteria",
        fieldValues: [
            {
                ruleKey: "foo",
                resourceKey: "bar",
            },
            {
                ruleKey: "foo2",
                resourceKey: "bar2",
            },
        ],
    });
    
    import pulumi
    import pulumi_sonarqube as sonarqube
    
    multi_field_setting = sonarqube.Setting("multiFieldSetting",
        key="sonar.issue.ignore.multicriteria",
        field_values=[
            {
                "ruleKey": "foo",
                "resourceKey": "bar",
            },
            {
                "ruleKey": "foo2",
                "resourceKey": "bar2",
            },
        ])
    
    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 {
    		_, err := sonarqube.NewSetting(ctx, "multiFieldSetting", &sonarqube.SettingArgs{
    			Key: pulumi.String("sonar.issue.ignore.multicriteria"),
    			FieldValues: pulumi.StringMapArray{
    				pulumi.StringMap{
    					"ruleKey":     pulumi.String("foo"),
    					"resourceKey": pulumi.String("bar"),
    				},
    				pulumi.StringMap{
    					"ruleKey":     pulumi.String("foo2"),
    					"resourceKey": pulumi.String("bar2"),
    				},
    			},
    		})
    		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 multiFieldSetting = new Sonarqube.Setting("multiFieldSetting", new()
        {
            Key = "sonar.issue.ignore.multicriteria",
            FieldValues = new[]
            {
                
                {
                    { "ruleKey", "foo" },
                    { "resourceKey", "bar" },
                },
                
                {
                    { "ruleKey", "foo2" },
                    { "resourceKey", "bar2" },
                },
            },
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.sonarqube.Setting;
    import com.pulumi.sonarqube.SettingArgs;
    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 multiFieldSetting = new Setting("multiFieldSetting", SettingArgs.builder()
                .key("sonar.issue.ignore.multicriteria")
                .fieldValues(            
                    Map.ofEntries(
                        Map.entry("ruleKey", "foo"),
                        Map.entry("resourceKey", "bar")
                    ),
                    Map.ofEntries(
                        Map.entry("ruleKey", "foo2"),
                        Map.entry("resourceKey", "bar2")
                    ))
                .build());
    
        }
    }
    
    resources:
      multiFieldSetting:
        type: sonarqube:Setting
        properties:
          key: sonar.issue.ignore.multicriteria
          fieldValues:
            - ruleKey: foo
              resourceKey: bar
            - ruleKey: foo2
              resourceKey: bar2
    

    Create Setting Resource

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

    Constructor syntax

    new Setting(name: string, args: SettingArgs, opts?: CustomResourceOptions);
    @overload
    def Setting(resource_name: str,
                args: SettingArgs,
                opts: Optional[ResourceOptions] = None)
    
    @overload
    def Setting(resource_name: str,
                opts: Optional[ResourceOptions] = None,
                key: Optional[str] = None,
                field_values: Optional[Sequence[Mapping[str, str]]] = None,
                setting_id: Optional[str] = None,
                value: Optional[str] = None,
                values: Optional[Sequence[str]] = None)
    func NewSetting(ctx *Context, name string, args SettingArgs, opts ...ResourceOption) (*Setting, error)
    public Setting(string name, SettingArgs args, CustomResourceOptions? opts = null)
    public Setting(String name, SettingArgs args)
    public Setting(String name, SettingArgs args, CustomResourceOptions options)
    
    type: sonarqube:Setting
    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 SettingArgs
    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 SettingArgs
    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 SettingArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args SettingArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args SettingArgs
    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 settingResource = new Sonarqube.Setting("settingResource", new()
    {
        Key = "string",
        FieldValues = new[]
        {
            
            {
                { "string", "string" },
            },
        },
        SettingId = "string",
        Value = "string",
        Values = new[]
        {
            "string",
        },
    });
    
    example, err := sonarqube.NewSetting(ctx, "settingResource", &sonarqube.SettingArgs{
    	Key: pulumi.String("string"),
    	FieldValues: pulumi.StringMapArray{
    		pulumi.StringMap{
    			"string": pulumi.String("string"),
    		},
    	},
    	SettingId: pulumi.String("string"),
    	Value:     pulumi.String("string"),
    	Values: pulumi.StringArray{
    		pulumi.String("string"),
    	},
    })
    
    var settingResource = new Setting("settingResource", SettingArgs.builder()
        .key("string")
        .fieldValues(Map.of("string", "string"))
        .settingId("string")
        .value("string")
        .values("string")
        .build());
    
    setting_resource = sonarqube.Setting("settingResource",
        key="string",
        field_values=[{
            "string": "string",
        }],
        setting_id="string",
        value="string",
        values=["string"])
    
    const settingResource = new sonarqube.Setting("settingResource", {
        key: "string",
        fieldValues: [{
            string: "string",
        }],
        settingId: "string",
        value: "string",
        values: ["string"],
    });
    
    type: sonarqube:Setting
    properties:
        fieldValues:
            - string: string
        key: string
        settingId: string
        value: string
        values:
            - string
    

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

    Key string
    Setting key
    FieldValues List<ImmutableDictionary<string, string>>
    Setting field values for the supplied key
    SettingId string
    The ID of this resource.
    Value string
    Setting value. To reset a value, please use the reset web service.
    Values List<string>
    Setting multi values for the supplied key
    Key string
    Setting key
    FieldValues []map[string]string
    Setting field values for the supplied key
    SettingId string
    The ID of this resource.
    Value string
    Setting value. To reset a value, please use the reset web service.
    Values []string
    Setting multi values for the supplied key
    key String
    Setting key
    fieldValues List<Map<String,String>>
    Setting field values for the supplied key
    settingId String
    The ID of this resource.
    value String
    Setting value. To reset a value, please use the reset web service.
    values List<String>
    Setting multi values for the supplied key
    key string
    Setting key
    fieldValues {[key: string]: string}[]
    Setting field values for the supplied key
    settingId string
    The ID of this resource.
    value string
    Setting value. To reset a value, please use the reset web service.
    values string[]
    Setting multi values for the supplied key
    key str
    Setting key
    field_values Sequence[Mapping[str, str]]
    Setting field values for the supplied key
    setting_id str
    The ID of this resource.
    value str
    Setting value. To reset a value, please use the reset web service.
    values Sequence[str]
    Setting multi values for the supplied key
    key String
    Setting key
    fieldValues List<Map<String>>
    Setting field values for the supplied key
    settingId String
    The ID of this resource.
    value String
    Setting value. To reset a value, please use the reset web service.
    values List<String>
    Setting multi values for the supplied key

    Outputs

    All input properties are implicitly available as output properties. Additionally, the Setting 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 Setting Resource

    Get an existing Setting 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?: SettingState, opts?: CustomResourceOptions): Setting
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            field_values: Optional[Sequence[Mapping[str, str]]] = None,
            key: Optional[str] = None,
            setting_id: Optional[str] = None,
            value: Optional[str] = None,
            values: Optional[Sequence[str]] = None) -> Setting
    func GetSetting(ctx *Context, name string, id IDInput, state *SettingState, opts ...ResourceOption) (*Setting, error)
    public static Setting Get(string name, Input<string> id, SettingState? state, CustomResourceOptions? opts = null)
    public static Setting get(String name, Output<String> id, SettingState state, CustomResourceOptions options)
    resources:  _:    type: sonarqube:Setting    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:
    FieldValues List<ImmutableDictionary<string, string>>
    Setting field values for the supplied key
    Key string
    Setting key
    SettingId string
    The ID of this resource.
    Value string
    Setting value. To reset a value, please use the reset web service.
    Values List<string>
    Setting multi values for the supplied key
    FieldValues []map[string]string
    Setting field values for the supplied key
    Key string
    Setting key
    SettingId string
    The ID of this resource.
    Value string
    Setting value. To reset a value, please use the reset web service.
    Values []string
    Setting multi values for the supplied key
    fieldValues List<Map<String,String>>
    Setting field values for the supplied key
    key String
    Setting key
    settingId String
    The ID of this resource.
    value String
    Setting value. To reset a value, please use the reset web service.
    values List<String>
    Setting multi values for the supplied key
    fieldValues {[key: string]: string}[]
    Setting field values for the supplied key
    key string
    Setting key
    settingId string
    The ID of this resource.
    value string
    Setting value. To reset a value, please use the reset web service.
    values string[]
    Setting multi values for the supplied key
    field_values Sequence[Mapping[str, str]]
    Setting field values for the supplied key
    key str
    Setting key
    setting_id str
    The ID of this resource.
    value str
    Setting value. To reset a value, please use the reset web service.
    values Sequence[str]
    Setting multi values for the supplied key
    fieldValues List<Map<String>>
    Setting field values for the supplied key
    key String
    Setting key
    settingId String
    The ID of this resource.
    value String
    Setting value. To reset a value, please use the reset web service.
    values List<String>
    Setting multi values for the supplied key

    Package Details

    Repository
    sonarqube jdamata/terraform-provider-sonarqube
    License
    Notes
    This Pulumi package is based on the sonarqube Terraform Provider.
    sonarqube logo
    sonarqube 0.16.14 published on Monday, Apr 14, 2025 by jdamata