Skip to content

Commit

Permalink
gcp data
Browse files Browse the repository at this point in the history
  • Loading branch information
JamesWoolfenden committed Nov 24, 2023
1 parent e568833 commit 7f8efa1
Show file tree
Hide file tree
Showing 24 changed files with 280 additions and 92 deletions.
12 changes: 1 addition & 11 deletions src/coverage/google.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# todo google

Resource percentage coverage 10.22
Datasource percentage coverage 48.19
Datasource percentage coverage 52.61

./resource.ps1 google_access_context_manager_access_level
./resource.ps1 google_access_context_manager_access_level_condition
Expand Down Expand Up @@ -826,16 +826,6 @@ Datasource percentage coverage 48.19
./resource.ps1 google_secret_manager_secrets -type data
./resource.ps1 google_service_directory_namespace_iam_policy -type data
./resource.ps1 google_service_directory_service_iam_policy -type data
./resource.ps1 google_sourcerepo_repository -type data
./resource.ps1 google_sourcerepo_repository_iam_policy -type data
./resource.ps1 google_sql_backup_run -type data
./resource.ps1 google_sql_ca_certs -type data
./resource.ps1 google_sql_database -type data
./resource.ps1 google_sql_database_instance -type data
./resource.ps1 google_sql_database_instance_latest_recovery_time -type data
./resource.ps1 google_sql_database_instances -type data
./resource.ps1 google_sql_databases -type data
./resource.ps1 google_sql_tiers -type data
./resource.ps1 google_tags_tag_key -type data
./resource.ps1 google_tags_tag_key_iam_policy -type data
./resource.ps1 google_tags_tag_value -type data
Expand Down
24 changes: 24 additions & 0 deletions src/files_gcp_datasource.go
Original file line number Diff line number Diff line change
Expand Up @@ -327,3 +327,27 @@ var dataGoogleComputeSubnetworkIamPolicy []byte

//go:embed mapping/google/data/compute/google_compute_vpn_gateway.json
var dataGoogleComputeVpnGateway []byte

//go:embed mapping/google/data/containeranalysis/google_container_analysis_note_iam_policy.json
var dataGoogleContainerAnalysisNoteIamPolicy []byte

//go:embed mapping/google/data/container/google_container_cluster.json
var dataGoogleContainerCluster []byte

//go:embed mapping/google/data/source/google_sourcerepo_repository.json
var dataGoogleSourcerepoRepository []byte

//go:embed mapping/google/data/source/google_sourcerepo_repository_iam_policy.json
var dataGoogleSourcerepoRepositoryIamPolicy []byte

//go:embed mapping/google/data/cloudsql/google_sql_database.json
var dataGoogleSqlDatabase []byte

//go:embed mapping/google/data/cloudsql/google_sql_database_instance.json
var dataGoogleSqlDatabaseInstance []byte

//go:embed mapping/google/data/cloudsql/google_sql_database_instances.json
var dataGoogleSqlDatabaseInstances []byte

//go:embed mapping/google/data/cloudsql/google_sql_databases.json
var dataGoogleSqlDatabases []byte
138 changes: 75 additions & 63 deletions src/gcp_datasource.go

Large diffs are not rendered by default.

13 changes: 13 additions & 0 deletions src/mapping/google/data/cloudsql/google_sql_database.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
[
{
"apply": [],
"attributes": {
"tags": []
},
"destroy": [],
"modify": [],
"plan": [
"cloudsql.databases.get"
]
}
]
13 changes: 13 additions & 0 deletions src/mapping/google/data/cloudsql/google_sql_database_instance.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
[
{
"apply": [],
"attributes": {
"tags": []
},
"destroy": [],
"modify": [],
"plan": [
"cloudsql.instances.get"
]
}
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
[
{
"apply": [],
"attributes": {
"tags": []
},
"destroy": [],
"modify": [],
"plan": [
"cloudsql.instances.list"
]
}
]
13 changes: 13 additions & 0 deletions src/mapping/google/data/cloudsql/google_sql_databases.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
[
{
"apply": [],
"attributes": {
"tags": []
},
"destroy": [],
"modify": [],
"plan": [
"cloudsql.databases.list"
]
}
]
13 changes: 13 additions & 0 deletions src/mapping/google/data/container/google_container_cluster.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
[
{
"apply": [],
"attributes": {
"tags": []
},
"destroy": [],
"modify": [],
"plan": [
"container.clusters.get"
]
}
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
[
{
"apply": [],
"attributes": {
"tags": []
},
"destroy": [],
"modify": [],
"plan": [
"containeranalysis.notes.getIamPolicy"
]
}
]
13 changes: 13 additions & 0 deletions src/mapping/google/data/source/google_sourcerepo_repository.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
[
{
"apply": [],
"attributes": {
"tags": []
},
"destroy": [],
"modify": [],
"plan": [
"source.repos.get"
]
}
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
[
{
"apply": [],
"attributes": {
"tags": []
},
"destroy": [],
"modify": [],
"plan": [
"source.repos.getIamPolicy"
]
}
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
data "google_container_analysis_note_iam_policy" "pike" {
note = "pike"
}

output "policy" {
value = data.google_container_analysis_note_iam_policy.pike
}
3 changes: 3 additions & 0 deletions terraform/google/backup/data.google_container_cluster.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
data "google_container_cluster" "pike" {
name = "pike"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
data "google_container_engine_versions" "pike" {}

output "versions" {
value = data.google_container_engine_versions.pike
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
data "google_container_registry_image" "pike" {
name = "pike"
}

output "image" {
value = data.google_container_registry_image.pike
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
data "google_container_registry_repository" "pike" {}

output "repo" {
value = data.google_container_registry_repository.pike
}
3 changes: 3 additions & 0 deletions terraform/google/backup/data.google_sourcerepo_repository.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
data "google_sourcerepo_repository" "pike" {
name = "pike"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
data "google_sourcerepo_repository_iam_policy" "pike" {
repository = "pike"
}

output "policy" {
value = data.google_sourcerepo_repository_iam_policy.pike
}
4 changes: 4 additions & 0 deletions terraform/google/backup/data.google_sql_database.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
data "google_sql_database" "pike" {
instance = "pike"
name = "pike"
}
3 changes: 3 additions & 0 deletions terraform/google/backup/data.google_sql_database_instance.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
data "google_sql_database_instance" "pike" {
name = "pike"
}
5 changes: 5 additions & 0 deletions terraform/google/backup/data.google_sql_database_instances.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
data "google_sql_database_instances" "pike" {}

output "instances" {
value = data.google_sql_database_instances.pike
}
3 changes: 3 additions & 0 deletions terraform/google/backup/data.google_sql_databases.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
data "google_sql_databases" "pike" {
instance = "pike"
}
6 changes: 6 additions & 0 deletions terraform/google/backup/data.google_sql_tiers.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
data "google_sql_tiers" "pike" {}


output "tiers" {
value = data.google_sql_tiers.pike
}
36 changes: 18 additions & 18 deletions terraform/google/role/google_project_iam_custom_role.tf
Original file line number Diff line number Diff line change
Expand Up @@ -4,24 +4,24 @@ resource "google_project_iam_custom_role" "pike" {
title = "pike terraform user"
description = "A user with least privileges"
permissions = [
//ggoogle_compute_regions
"compute.regions.list",
//google_compute_resource_policy
"compute.resourcePolicies.get",
//google_compute_router, google_compute_router_nat,google_compute_router_status
"compute.routers.get",
//google_compute_snapshot
"compute.snapshots.get",
//google_compute_snapshot_iam_policy
"compute.snapshots.getIamPolicy",
//google_compute_ssl_certificate
"compute.sslCertificates.get",
//google_compute_ssl_policy
"compute.sslPolicies.get",
//google_compute_subnetwork_iam_policy
"compute.subnetworks.getIamPolicy",
//google_compute_vpn_gateway
"compute.targetVpnGateways.get"
//google_sourcerepo_repository
"source.repos.get",
//google_sourcerepo_repository_iam_policy
"source.repos.getIamPolicy",
//
"cloudsql.backupRuns.get",
"cloudsql.backupRuns.list",

//google_sql_database
"cloudsql.databases.get",
//google_sql_database_instance
"cloudsql.instances.get",
"cloudsql.instances.list",

"cloudsql.databases.list",

//notsure
"cloudsql.sslCerts.get",
"cloudsql.sslCerts.list"
]
}

0 comments on commit 7f8efa1

Please sign in to comment.