Skip to content

Commit 4306a2f

Browse files
authored
✨ gcp: new redis service to fetch instances (#5441)
Signed-off-by: Salim Afiune Maya <afiune@mondoo.com>
1 parent 3791d01 commit 4306a2f

File tree

6 files changed

+869
-0
lines changed

6 files changed

+869
-0
lines changed

providers/gcp/go.mod

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ require (
1717
cloud.google.com/go/monitoring v1.24.1
1818
cloud.google.com/go/pubsub v1.48.0
1919
cloud.google.com/go/recommender v1.13.4
20+
cloud.google.com/go/redis v1.18.1
2021
cloud.google.com/go/run v1.9.2
2122
cloud.google.com/go/serviceusage v1.9.5
2223
github.com/aws/smithy-go v1.22.3

providers/gcp/go.sum

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,8 @@ cloud.google.com/go/pubsub v1.48.0 h1:ntFpQVrr10Wj/GXSOpxGmexGynldv/bFp25H0jy8aO
7878
cloud.google.com/go/pubsub v1.48.0/go.mod h1:AAtyjyIT/+zaY1ERKFJbefOvkUxRDNp3nD6TdfdqUZk=
7979
cloud.google.com/go/recommender v1.13.4 h1:asqK5+A4yAhkpU7bC2MikNyxSACoi+Mt+zrkc+3OKB8=
8080
cloud.google.com/go/recommender v1.13.4/go.mod h1:2xpcTYCOy2JlePWcMcVqS+dNiiMNCNGT/PtsjGP1BTQ=
81+
cloud.google.com/go/redis v1.18.1 h1:0KQR82vHH2nEy+7H7lj3SB19USNnvARMct/RUqqOYwk=
82+
cloud.google.com/go/redis v1.18.1/go.mod h1:lZQIhkqbhlmqGlFws6yzxSt2qNrAsPDHozWYGvXywqM=
8183
cloud.google.com/go/run v1.9.2 h1:IdgRA467y1EPOsVKZA9702lCCXb58WLcV+wAhCmEzkk=
8284
cloud.google.com/go/run v1.9.2/go.mod h1:QD5H5hNuz900FYLQGtbMlA0dqZogy/Wj0xpLwTzK2+Q=
8385
cloud.google.com/go/secretmanager v1.14.6 h1:/ooktIMSORaWk9gm3vf8+Mg+zSrUplJFKBztP993oL0=

providers/gcp/resources/gcp.lr

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,85 @@ private gcp.folders {
4949
children() []gcp.folder
5050
}
5151

52+
// Google Cloud (GCP) Redis
53+
private gcp.project.redisService {
54+
// Project ID
55+
projectId string
56+
// List all redis instances
57+
instances() []gcp.project.redisService.instance
58+
}
59+
60+
// Google Cloud (GCP) Redis instance
61+
private gcp.project.redisService.instance @defaults("name") {
62+
// Unique name of the resource in this scope including project and location
63+
name string
64+
// Project ID
65+
projectId string
66+
// An arbitrary and optional user-provided name for the instance
67+
displayName string
68+
// Resource labels to represent user provided metadata
69+
Labels map[string]string
70+
// The zone where the instance will be provisioned
71+
locationId string
72+
// The version of Redis software
73+
redisVersion string
74+
// The CIDR range of internal addresses that are reserved for this instance
75+
reservedIpRange string
76+
// Additional IP range for node placement
77+
secondaryIpRange string
78+
// Hostname or IP address of the exposed Redis endpoint used by clients to connect to the service
79+
host string
80+
// The port number of the exposed Redis endpoint
81+
port int
82+
// The current zone where the Redis primary node is located
83+
currentLocationId string
84+
// The time the instance was created
85+
createTime time
86+
// The current state of this instance
87+
state string
88+
// Additional information about the current status of this instance, if available
89+
statusMessage string
90+
// Redis configuration parameters, according to http://redis.io/topics/config
91+
redisConfigs map[string]string
92+
// Redis memory size in GiB
93+
memorySizeGb int
94+
// The full name of the Google Compute Engine
95+
// [network](https://cloud.google.com/vpc/docs/vpc) to which the
96+
// instance is connected. If left unspecified, the `default` network
97+
// will be used
98+
AuthorizedNetwork string
99+
// Cloud IAM identity used by import / export operations to transfer data to/from Cloud Storage
100+
persistenceIamIdentity string
101+
// The network connect mode of the Redis instance
102+
connectMode string
103+
// Redis AUTH is enabled or not for the instance. If set to "true" AUTH is enabled on the instance
104+
authEnabled bool
105+
// The number of replica nodes
106+
replicaCount int
107+
// Info per node
108+
nodes []gcp.project.redisService.instance.nodeInfo
109+
// Hostname or IP address of the exposed readonly Redis endpoint
110+
readEndpoint string
111+
// The port number of the exposed readonly redis endpoint
112+
readEndpointPort int
113+
// The KMS key reference that the customer provides when trying to create the instance
114+
customerManagedKey string
115+
// The self service update maintenance version
116+
maintenanceVersion string
117+
// The available maintenance versions that an instance could update to
118+
availableMaintenanceVersions []string
119+
}
120+
121+
// Google Cloud (GCP) Redis instance node information
122+
private gcp.project.redisService.instance.nodeInfo @defaults("id zone") {
123+
// Project ID
124+
projectId string
125+
// Node identifying string (e.g. `node-0`, `node-1`)
126+
id string
127+
// Location of the node
128+
zone string
129+
}
130+
52131
// Google Cloud (GCP) folder
53132
private gcp.folder @defaults("name") {
54133
// Folder ID
@@ -140,6 +219,8 @@ gcp.project @defaults("name") {
140219
monitoring() gcp.project.monitoringService
141220
// Binary Authorization resources
142221
binaryAuthorization() gcp.project.binaryAuthorizationControl
222+
// GCP Redis resources
223+
redis() gcp.project.redisService
143224
}
144225

145226
// Google Cloud (GCP) service

0 commit comments

Comments
 (0)