-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
(Upstreaming) Add KMS support to bigquery tables. (#2784)
Merged PR #2784.
- Loading branch information
1 parent
5eb989d
commit 75c7575
Showing
8 changed files
with
331 additions
and
130 deletions.
There are no files selected for viewing
Submodule terraform
updated
from dcc25b to bdbc4c
Submodule terraform-beta
updated
from 826eb7 to df0b3f
41 changes: 41 additions & 0 deletions
41
third_party/terraform/data_sources/data_source_google_bigquery_default_service_account.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
package google | ||
|
||
import ( | ||
"github.com/hashicorp/terraform-plugin-sdk/helper/schema" | ||
) | ||
|
||
func dataSourceGoogleBigqueryDefaultServiceAccount() *schema.Resource { | ||
return &schema.Resource{ | ||
Read: dataSourceGoogleBigqueryDefaultServiceAccountRead, | ||
Schema: map[string]*schema.Schema{ | ||
"email": { | ||
Type: schema.TypeString, | ||
Computed: true, | ||
}, | ||
"project": { | ||
Type: schema.TypeString, | ||
Optional: true, | ||
Computed: true, | ||
}, | ||
}, | ||
} | ||
} | ||
|
||
func dataSourceGoogleBigqueryDefaultServiceAccountRead(d *schema.ResourceData, meta interface{}) error { | ||
config := meta.(*Config) | ||
|
||
project, err := getProject(d, config) | ||
if err != nil { | ||
return err | ||
} | ||
|
||
projectResource, err := config.clientBigQuery.Projects.GetServiceAccount(project).Do() | ||
if err != nil { | ||
return handleNotFoundError(err, d, "GCE service account not found") | ||
} | ||
|
||
d.SetId(projectResource.Email) | ||
d.Set("email", projectResource.Email) | ||
d.Set("project", project) | ||
return nil | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.