Grafana v0.4.2 published on Monday, Apr 15, 2024 by pulumiverse
grafana.DataSource
Explore with Pulumi AI
Create DataSource Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new DataSource(name: string, args: DataSourceArgs, opts?: CustomResourceOptions);
@overload
def DataSource(resource_name: str,
args: DataSourceArgs,
opts: Optional[ResourceOptions] = None)
@overload
def DataSource(resource_name: str,
opts: Optional[ResourceOptions] = None,
type: Optional[str] = None,
json_data_encoded: Optional[str] = None,
basic_auth_username: Optional[str] = None,
database_name: Optional[str] = None,
http_headers: Optional[Mapping[str, str]] = None,
is_default: Optional[bool] = None,
access_mode: Optional[str] = None,
name: Optional[str] = None,
org_id: Optional[str] = None,
secure_json_data_encoded: Optional[str] = None,
basic_auth_enabled: Optional[bool] = None,
uid: Optional[str] = None,
url: Optional[str] = None,
username: Optional[str] = None)
func NewDataSource(ctx *Context, name string, args DataSourceArgs, opts ...ResourceOption) (*DataSource, error)
public DataSource(string name, DataSourceArgs args, CustomResourceOptions? opts = null)
public DataSource(String name, DataSourceArgs args)
public DataSource(String name, DataSourceArgs args, CustomResourceOptions options)
type: grafana:DataSource
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 DataSourceArgs
- 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 DataSourceArgs
- 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 DataSourceArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args DataSourceArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args DataSourceArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
Example
The following reference example uses placeholder values for all input properties.
var dataSourceResource = new Grafana.DataSource("dataSourceResource", new()
{
Type = "string",
JsonDataEncoded = "string",
BasicAuthUsername = "string",
DatabaseName = "string",
HttpHeaders =
{
{ "string", "string" },
},
IsDefault = false,
AccessMode = "string",
Name = "string",
OrgId = "string",
SecureJsonDataEncoded = "string",
BasicAuthEnabled = false,
Uid = "string",
Url = "string",
Username = "string",
});
example, err := grafana.NewDataSource(ctx, "dataSourceResource", &grafana.DataSourceArgs{
Type: pulumi.String("string"),
JsonDataEncoded: pulumi.String("string"),
BasicAuthUsername: pulumi.String("string"),
DatabaseName: pulumi.String("string"),
HttpHeaders: pulumi.StringMap{
"string": pulumi.String("string"),
},
IsDefault: pulumi.Bool(false),
AccessMode: pulumi.String("string"),
Name: pulumi.String("string"),
OrgId: pulumi.String("string"),
SecureJsonDataEncoded: pulumi.String("string"),
BasicAuthEnabled: pulumi.Bool(false),
Uid: pulumi.String("string"),
Url: pulumi.String("string"),
Username: pulumi.String("string"),
})
var dataSourceResource = new DataSource("dataSourceResource", DataSourceArgs.builder()
.type("string")
.jsonDataEncoded("string")
.basicAuthUsername("string")
.databaseName("string")
.httpHeaders(Map.of("string", "string"))
.isDefault(false)
.accessMode("string")
.name("string")
.orgId("string")
.secureJsonDataEncoded("string")
.basicAuthEnabled(false)
.uid("string")
.url("string")
.username("string")
.build());
data_source_resource = grafana.DataSource("dataSourceResource",
type="string",
json_data_encoded="string",
basic_auth_username="string",
database_name="string",
http_headers={
"string": "string",
},
is_default=False,
access_mode="string",
name="string",
org_id="string",
secure_json_data_encoded="string",
basic_auth_enabled=False,
uid="string",
url="string",
username="string")
const dataSourceResource = new grafana.DataSource("dataSourceResource", {
type: "string",
jsonDataEncoded: "string",
basicAuthUsername: "string",
databaseName: "string",
httpHeaders: {
string: "string",
},
isDefault: false,
accessMode: "string",
name: "string",
orgId: "string",
secureJsonDataEncoded: "string",
basicAuthEnabled: false,
uid: "string",
url: "string",
username: "string",
});
type: grafana:DataSource
properties:
accessMode: string
basicAuthEnabled: false
basicAuthUsername: string
databaseName: string
httpHeaders:
string: string
isDefault: false
jsonDataEncoded: string
name: string
orgId: string
secureJsonDataEncoded: string
type: string
uid: string
url: string
username: string
DataSource 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 DataSource resource accepts the following input properties:
- Type string
- The data source type. Must be one of the supported data source keywords.
- Access
Mode string - The method by which Grafana will access the data source:
proxy
ordirect
. - Basic
Auth boolEnabled - Whether to enable basic auth for the data source.
- Basic
Auth stringUsername - Basic auth username.
- Database
Name string - (Required by some data source types) The name of the database to use on the selected data source server.
- Http
Headers Dictionary<string, string> - Custom HTTP headers
- Is
Default bool - Whether to set the data source as default. This should only be
true
to a single data source. - Json
Data stringEncoded - Serialized JSON string containing the json data. This attribute can be used to pass configuration options to the data source. To figure out what options a datasource has available, see its docs or inspect the network data when saving it from the Grafana UI. Note that keys in this map are usually camelCased.
- Name string
- A unique name for the data source.
- Org
Id string - The Organization ID. If not set, the Org ID defined in the provider block will be used.
- Secure
Json stringData Encoded - Serialized JSON string containing the secure json data. This attribute can be used to pass secure configuration options to the data source. To figure out what options a datasource has available, see its docs or inspect the network data when saving it from the Grafana UI. Note that keys in this map are usually camelCased.
- Uid string
- Unique identifier. If unset, this will be automatically generated.
- Url string
- The URL for the data source. The type of URL required varies depending on the chosen data source type.
- Username string
- (Required by some data source types) The username to use to authenticate to the data source.
- Type string
- The data source type. Must be one of the supported data source keywords.
- Access
Mode string - The method by which Grafana will access the data source:
proxy
ordirect
. - Basic
Auth boolEnabled - Whether to enable basic auth for the data source.
- Basic
Auth stringUsername - Basic auth username.
- Database
Name string - (Required by some data source types) The name of the database to use on the selected data source server.
- Http
Headers map[string]string - Custom HTTP headers
- Is
Default bool - Whether to set the data source as default. This should only be
true
to a single data source. - Json
Data stringEncoded - Serialized JSON string containing the json data. This attribute can be used to pass configuration options to the data source. To figure out what options a datasource has available, see its docs or inspect the network data when saving it from the Grafana UI. Note that keys in this map are usually camelCased.
- Name string
- A unique name for the data source.
- Org
Id string - The Organization ID. If not set, the Org ID defined in the provider block will be used.
- Secure
Json stringData Encoded - Serialized JSON string containing the secure json data. This attribute can be used to pass secure configuration options to the data source. To figure out what options a datasource has available, see its docs or inspect the network data when saving it from the Grafana UI. Note that keys in this map are usually camelCased.
- Uid string
- Unique identifier. If unset, this will be automatically generated.
- Url string
- The URL for the data source. The type of URL required varies depending on the chosen data source type.
- Username string
- (Required by some data source types) The username to use to authenticate to the data source.
- type String
- The data source type. Must be one of the supported data source keywords.
- access
Mode String - The method by which Grafana will access the data source:
proxy
ordirect
. - basic
Auth BooleanEnabled - Whether to enable basic auth for the data source.
- basic
Auth StringUsername - Basic auth username.
- database
Name String - (Required by some data source types) The name of the database to use on the selected data source server.
- http
Headers Map<String,String> - Custom HTTP headers
- is
Default Boolean - Whether to set the data source as default. This should only be
true
to a single data source. - json
Data StringEncoded - Serialized JSON string containing the json data. This attribute can be used to pass configuration options to the data source. To figure out what options a datasource has available, see its docs or inspect the network data when saving it from the Grafana UI. Note that keys in this map are usually camelCased.
- name String
- A unique name for the data source.
- org
Id String - The Organization ID. If not set, the Org ID defined in the provider block will be used.
- secure
Json StringData Encoded - Serialized JSON string containing the secure json data. This attribute can be used to pass secure configuration options to the data source. To figure out what options a datasource has available, see its docs or inspect the network data when saving it from the Grafana UI. Note that keys in this map are usually camelCased.
- uid String
- Unique identifier. If unset, this will be automatically generated.
- url String
- The URL for the data source. The type of URL required varies depending on the chosen data source type.
- username String
- (Required by some data source types) The username to use to authenticate to the data source.
- type string
- The data source type. Must be one of the supported data source keywords.
- access
Mode string - The method by which Grafana will access the data source:
proxy
ordirect
. - basic
Auth booleanEnabled - Whether to enable basic auth for the data source.
- basic
Auth stringUsername - Basic auth username.
- database
Name string - (Required by some data source types) The name of the database to use on the selected data source server.
- http
Headers {[key: string]: string} - Custom HTTP headers
- is
Default boolean - Whether to set the data source as default. This should only be
true
to a single data source. - json
Data stringEncoded - Serialized JSON string containing the json data. This attribute can be used to pass configuration options to the data source. To figure out what options a datasource has available, see its docs or inspect the network data when saving it from the Grafana UI. Note that keys in this map are usually camelCased.
- name string
- A unique name for the data source.
- org
Id string - The Organization ID. If not set, the Org ID defined in the provider block will be used.
- secure
Json stringData Encoded - Serialized JSON string containing the secure json data. This attribute can be used to pass secure configuration options to the data source. To figure out what options a datasource has available, see its docs or inspect the network data when saving it from the Grafana UI. Note that keys in this map are usually camelCased.
- uid string
- Unique identifier. If unset, this will be automatically generated.
- url string
- The URL for the data source. The type of URL required varies depending on the chosen data source type.
- username string
- (Required by some data source types) The username to use to authenticate to the data source.
- type str
- The data source type. Must be one of the supported data source keywords.
- access_
mode str - The method by which Grafana will access the data source:
proxy
ordirect
. - basic_
auth_ boolenabled - Whether to enable basic auth for the data source.
- basic_
auth_ strusername - Basic auth username.
- database_
name str - (Required by some data source types) The name of the database to use on the selected data source server.
- http_
headers Mapping[str, str] - Custom HTTP headers
- is_
default bool - Whether to set the data source as default. This should only be
true
to a single data source. - json_
data_ strencoded - Serialized JSON string containing the json data. This attribute can be used to pass configuration options to the data source. To figure out what options a datasource has available, see its docs or inspect the network data when saving it from the Grafana UI. Note that keys in this map are usually camelCased.
- name str
- A unique name for the data source.
- org_
id str - The Organization ID. If not set, the Org ID defined in the provider block will be used.
- secure_
json_ strdata_ encoded - Serialized JSON string containing the secure json data. This attribute can be used to pass secure configuration options to the data source. To figure out what options a datasource has available, see its docs or inspect the network data when saving it from the Grafana UI. Note that keys in this map are usually camelCased.
- uid str
- Unique identifier. If unset, this will be automatically generated.
- url str
- The URL for the data source. The type of URL required varies depending on the chosen data source type.
- username str
- (Required by some data source types) The username to use to authenticate to the data source.
- type String
- The data source type. Must be one of the supported data source keywords.
- access
Mode String - The method by which Grafana will access the data source:
proxy
ordirect
. - basic
Auth BooleanEnabled - Whether to enable basic auth for the data source.
- basic
Auth StringUsername - Basic auth username.
- database
Name String - (Required by some data source types) The name of the database to use on the selected data source server.
- http
Headers Map<String> - Custom HTTP headers
- is
Default Boolean - Whether to set the data source as default. This should only be
true
to a single data source. - json
Data StringEncoded - Serialized JSON string containing the json data. This attribute can be used to pass configuration options to the data source. To figure out what options a datasource has available, see its docs or inspect the network data when saving it from the Grafana UI. Note that keys in this map are usually camelCased.
- name String
- A unique name for the data source.
- org
Id String - The Organization ID. If not set, the Org ID defined in the provider block will be used.
- secure
Json StringData Encoded - Serialized JSON string containing the secure json data. This attribute can be used to pass secure configuration options to the data source. To figure out what options a datasource has available, see its docs or inspect the network data when saving it from the Grafana UI. Note that keys in this map are usually camelCased.
- uid String
- Unique identifier. If unset, this will be automatically generated.
- url String
- The URL for the data source. The type of URL required varies depending on the chosen data source type.
- username String
- (Required by some data source types) The username to use to authenticate to the data source.
Outputs
All input properties are implicitly available as output properties. Additionally, the DataSource 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 DataSource Resource
Get an existing DataSource 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?: DataSourceState, opts?: CustomResourceOptions): DataSource
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
access_mode: Optional[str] = None,
basic_auth_enabled: Optional[bool] = None,
basic_auth_username: Optional[str] = None,
database_name: Optional[str] = None,
http_headers: Optional[Mapping[str, str]] = None,
is_default: Optional[bool] = None,
json_data_encoded: Optional[str] = None,
name: Optional[str] = None,
org_id: Optional[str] = None,
secure_json_data_encoded: Optional[str] = None,
type: Optional[str] = None,
uid: Optional[str] = None,
url: Optional[str] = None,
username: Optional[str] = None) -> DataSource
func GetDataSource(ctx *Context, name string, id IDInput, state *DataSourceState, opts ...ResourceOption) (*DataSource, error)
public static DataSource Get(string name, Input<string> id, DataSourceState? state, CustomResourceOptions? opts = null)
public static DataSource get(String name, Output<String> id, DataSourceState state, CustomResourceOptions options)
Resource lookup is not supported in YAML
- 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.
- Access
Mode string - The method by which Grafana will access the data source:
proxy
ordirect
. - Basic
Auth boolEnabled - Whether to enable basic auth for the data source.
- Basic
Auth stringUsername - Basic auth username.
- Database
Name string - (Required by some data source types) The name of the database to use on the selected data source server.
- Http
Headers Dictionary<string, string> - Custom HTTP headers
- Is
Default bool - Whether to set the data source as default. This should only be
true
to a single data source. - Json
Data stringEncoded - Serialized JSON string containing the json data. This attribute can be used to pass configuration options to the data source. To figure out what options a datasource has available, see its docs or inspect the network data when saving it from the Grafana UI. Note that keys in this map are usually camelCased.
- Name string
- A unique name for the data source.
- Org
Id string - The Organization ID. If not set, the Org ID defined in the provider block will be used.
- Secure
Json stringData Encoded - Serialized JSON string containing the secure json data. This attribute can be used to pass secure configuration options to the data source. To figure out what options a datasource has available, see its docs or inspect the network data when saving it from the Grafana UI. Note that keys in this map are usually camelCased.
- Type string
- The data source type. Must be one of the supported data source keywords.
- Uid string
- Unique identifier. If unset, this will be automatically generated.
- Url string
- The URL for the data source. The type of URL required varies depending on the chosen data source type.
- Username string
- (Required by some data source types) The username to use to authenticate to the data source.
- Access
Mode string - The method by which Grafana will access the data source:
proxy
ordirect
. - Basic
Auth boolEnabled - Whether to enable basic auth for the data source.
- Basic
Auth stringUsername - Basic auth username.
- Database
Name string - (Required by some data source types) The name of the database to use on the selected data source server.
- Http
Headers map[string]string - Custom HTTP headers
- Is
Default bool - Whether to set the data source as default. This should only be
true
to a single data source. - Json
Data stringEncoded - Serialized JSON string containing the json data. This attribute can be used to pass configuration options to the data source. To figure out what options a datasource has available, see its docs or inspect the network data when saving it from the Grafana UI. Note that keys in this map are usually camelCased.
- Name string
- A unique name for the data source.
- Org
Id string - The Organization ID. If not set, the Org ID defined in the provider block will be used.
- Secure
Json stringData Encoded - Serialized JSON string containing the secure json data. This attribute can be used to pass secure configuration options to the data source. To figure out what options a datasource has available, see its docs or inspect the network data when saving it from the Grafana UI. Note that keys in this map are usually camelCased.
- Type string
- The data source type. Must be one of the supported data source keywords.
- Uid string
- Unique identifier. If unset, this will be automatically generated.
- Url string
- The URL for the data source. The type of URL required varies depending on the chosen data source type.
- Username string
- (Required by some data source types) The username to use to authenticate to the data source.
- access
Mode String - The method by which Grafana will access the data source:
proxy
ordirect
. - basic
Auth BooleanEnabled - Whether to enable basic auth for the data source.
- basic
Auth StringUsername - Basic auth username.
- database
Name String - (Required by some data source types) The name of the database to use on the selected data source server.
- http
Headers Map<String,String> - Custom HTTP headers
- is
Default Boolean - Whether to set the data source as default. This should only be
true
to a single data source. - json
Data StringEncoded - Serialized JSON string containing the json data. This attribute can be used to pass configuration options to the data source. To figure out what options a datasource has available, see its docs or inspect the network data when saving it from the Grafana UI. Note that keys in this map are usually camelCased.
- name String
- A unique name for the data source.
- org
Id String - The Organization ID. If not set, the Org ID defined in the provider block will be used.
- secure
Json StringData Encoded - Serialized JSON string containing the secure json data. This attribute can be used to pass secure configuration options to the data source. To figure out what options a datasource has available, see its docs or inspect the network data when saving it from the Grafana UI. Note that keys in this map are usually camelCased.
- type String
- The data source type. Must be one of the supported data source keywords.
- uid String
- Unique identifier. If unset, this will be automatically generated.
- url String
- The URL for the data source. The type of URL required varies depending on the chosen data source type.
- username String
- (Required by some data source types) The username to use to authenticate to the data source.
- access
Mode string - The method by which Grafana will access the data source:
proxy
ordirect
. - basic
Auth booleanEnabled - Whether to enable basic auth for the data source.
- basic
Auth stringUsername - Basic auth username.
- database
Name string - (Required by some data source types) The name of the database to use on the selected data source server.
- http
Headers {[key: string]: string} - Custom HTTP headers
- is
Default boolean - Whether to set the data source as default. This should only be
true
to a single data source. - json
Data stringEncoded - Serialized JSON string containing the json data. This attribute can be used to pass configuration options to the data source. To figure out what options a datasource has available, see its docs or inspect the network data when saving it from the Grafana UI. Note that keys in this map are usually camelCased.
- name string
- A unique name for the data source.
- org
Id string - The Organization ID. If not set, the Org ID defined in the provider block will be used.
- secure
Json stringData Encoded - Serialized JSON string containing the secure json data. This attribute can be used to pass secure configuration options to the data source. To figure out what options a datasource has available, see its docs or inspect the network data when saving it from the Grafana UI. Note that keys in this map are usually camelCased.
- type string
- The data source type. Must be one of the supported data source keywords.
- uid string
- Unique identifier. If unset, this will be automatically generated.
- url string
- The URL for the data source. The type of URL required varies depending on the chosen data source type.
- username string
- (Required by some data source types) The username to use to authenticate to the data source.
- access_
mode str - The method by which Grafana will access the data source:
proxy
ordirect
. - basic_
auth_ boolenabled - Whether to enable basic auth for the data source.
- basic_
auth_ strusername - Basic auth username.
- database_
name str - (Required by some data source types) The name of the database to use on the selected data source server.
- http_
headers Mapping[str, str] - Custom HTTP headers
- is_
default bool - Whether to set the data source as default. This should only be
true
to a single data source. - json_
data_ strencoded - Serialized JSON string containing the json data. This attribute can be used to pass configuration options to the data source. To figure out what options a datasource has available, see its docs or inspect the network data when saving it from the Grafana UI. Note that keys in this map are usually camelCased.
- name str
- A unique name for the data source.
- org_
id str - The Organization ID. If not set, the Org ID defined in the provider block will be used.
- secure_
json_ strdata_ encoded - Serialized JSON string containing the secure json data. This attribute can be used to pass secure configuration options to the data source. To figure out what options a datasource has available, see its docs or inspect the network data when saving it from the Grafana UI. Note that keys in this map are usually camelCased.
- type str
- The data source type. Must be one of the supported data source keywords.
- uid str
- Unique identifier. If unset, this will be automatically generated.
- url str
- The URL for the data source. The type of URL required varies depending on the chosen data source type.
- username str
- (Required by some data source types) The username to use to authenticate to the data source.
- access
Mode String - The method by which Grafana will access the data source:
proxy
ordirect
. - basic
Auth BooleanEnabled - Whether to enable basic auth for the data source.
- basic
Auth StringUsername - Basic auth username.
- database
Name String - (Required by some data source types) The name of the database to use on the selected data source server.
- http
Headers Map<String> - Custom HTTP headers
- is
Default Boolean - Whether to set the data source as default. This should only be
true
to a single data source. - json
Data StringEncoded - Serialized JSON string containing the json data. This attribute can be used to pass configuration options to the data source. To figure out what options a datasource has available, see its docs or inspect the network data when saving it from the Grafana UI. Note that keys in this map are usually camelCased.
- name String
- A unique name for the data source.
- org
Id String - The Organization ID. If not set, the Org ID defined in the provider block will be used.
- secure
Json StringData Encoded - Serialized JSON string containing the secure json data. This attribute can be used to pass secure configuration options to the data source. To figure out what options a datasource has available, see its docs or inspect the network data when saving it from the Grafana UI. Note that keys in this map are usually camelCased.
- type String
- The data source type. Must be one of the supported data source keywords.
- uid String
- Unique identifier. If unset, this will be automatically generated.
- url String
- The URL for the data source. The type of URL required varies depending on the chosen data source type.
- username String
- (Required by some data source types) The username to use to authenticate to the data source.
Package Details
- Repository
- grafana pulumiverse/pulumi-grafana
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
grafana
Terraform Provider.