@@ -68,6 +68,12 @@ source selected (via the 'type' argument).
6868 Default : false ,
6969 Description : "Whether to set the data source as default. This should only be `true` to a single data source." ,
7070 },
71+ "uid" : {
72+ Type : schema .TypeString ,
73+ Optional : true ,
74+ Computed : true ,
75+ Description : "Unique identifier. If unset, this will be automatically generated." ,
76+ },
7177 "json_data" : {
7278 Type : schema .TypeList ,
7379 Optional : true ,
@@ -439,6 +445,7 @@ func ReadDataSource(ctx context.Context, d *schema.ResourceData, meta interface{
439445 d .Set ("type" , dataSource .Type )
440446 d .Set ("url" , dataSource .URL )
441447 d .Set ("username" , dataSource .User )
448+ d .Set ("uid" , dataSource .UID )
442449
443450 // TODO: these fields should be migrated to SecureJSONData.
444451 d .Set ("basic_auth_enabled" , dataSource .BasicAuth )
@@ -487,6 +494,7 @@ func makeDataSource(d *schema.ResourceData) (*gapi.DataSource, error) {
487494 BasicAuth : d .Get ("basic_auth_enabled" ).(bool ),
488495 BasicAuthUser : d .Get ("basic_auth_username" ).(string ),
489496 BasicAuthPassword : d .Get ("basic_auth_password" ).(string ),
497+ UID : d .Get ("uid" ).(string ),
490498 JSONData : makeJSONData (d ),
491499 SecureJSONData : makeSecureJSONData (d ),
492500 }, err
0 commit comments