mirror of
https://github.com/letic/terraform-provider-google.git
synced 2024-09-07 09:36:44 +00:00
28 lines
741 B
Go
28 lines
741 B
Go
![]() |
package google
|
||
|
|
||
|
import (
|
||
|
"fmt"
|
||
|
|
||
|
"github.com/hashicorp/terraform/helper/schema"
|
||
|
)
|
||
|
|
||
|
func dataSourceGoogleProjectOrganizationPolicy() *schema.Resource {
|
||
|
// Generate datasource schema from resource
|
||
|
dsSchema := datasourceSchemaFromResourceSchema(resourceGoogleProjectOrganizationPolicy().Schema)
|
||
|
|
||
|
addRequiredFieldsToSchema(dsSchema, "project")
|
||
|
addRequiredFieldsToSchema(dsSchema, "constraint")
|
||
|
|
||
|
return &schema.Resource{
|
||
|
Read: datasourceGoogleProjectOrganizationPolicyRead,
|
||
|
Schema: dsSchema,
|
||
|
}
|
||
|
}
|
||
|
|
||
|
func datasourceGoogleProjectOrganizationPolicyRead(d *schema.ResourceData, meta interface{}) error {
|
||
|
|
||
|
d.SetId(fmt.Sprintf("%s:%s", d.Get("project"), d.Get("constraint")))
|
||
|
|
||
|
return resourceGoogleProjectOrganizationPolicyRead(d, meta)
|
||
|
}
|