Skip to content

Commit 3d935f3

Browse files
modular-magicianEdward Sunemilymye
authored
add desc to schema for logging resources (#3671) (#2223)
* add desc to schema for logging resources * Update third_party/terraform/resources/resource_logging_project_bucket_config.go Co-authored-by: emily <[email protected]> * Update third_party/terraform/resources/resource_logging_bucket_config.go Co-authored-by: emily <[email protected]> Co-authored-by: Edward Sun <[email protected]> Co-authored-by: emily <[email protected]> Signed-off-by: Modular Magician <[email protected]> Co-authored-by: Edward Sun <[email protected]> Co-authored-by: emily <[email protected]>
1 parent c46f4ba commit 3d935f3

12 files changed

+104
-74
lines changed

.changelog/3671.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
```release-note:none
2+
3+
```

google-beta/resource_logging_billing_account_bucket_config.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,10 @@ import (
99

1010
var loggingBillingAccountBucketConfigSchema = map[string]*schema.Schema{
1111
"billing_account": {
12-
Type: schema.TypeString,
13-
Required: true,
14-
ForceNew: true,
12+
Type: schema.TypeString,
13+
Required: true,
14+
ForceNew: true,
15+
Description: `The parent resource that contains the logging bucket.`,
1516
},
1617
}
1718

google-beta/resource_logging_billing_account_sink.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,10 @@ func resourceLoggingBillingAccountSink() *schema.Resource {
1818
},
1919
}
2020
schm.Schema["billing_account"] = &schema.Schema{
21-
Type: schema.TypeString,
22-
Required: true,
23-
ForceNew: true,
21+
Type: schema.TypeString,
22+
Required: true,
23+
ForceNew: true,
24+
Description: `The billing account exported to the sink.`,
2425
}
2526
return schm
2627
}

google-beta/resource_logging_bucket_config.go

Lines changed: 22 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -11,32 +11,38 @@ import (
1111

1212
var loggingBucketConfigSchema = map[string]*schema.Schema{
1313
"name": {
14-
Type: schema.TypeString,
15-
Computed: true,
14+
Type: schema.TypeString,
15+
Computed: true,
16+
Description: `The resource name of the bucket`,
1617
},
1718
"location": {
18-
Type: schema.TypeString,
19-
Required: true,
20-
ForceNew: true,
19+
Type: schema.TypeString,
20+
Required: true,
21+
ForceNew: true,
22+
Description: `The location of the bucket. The supported locations are: "global" "us-central1"`,
2123
},
2224
"bucket_id": {
23-
Type: schema.TypeString,
24-
Required: true,
25-
ForceNew: true,
25+
Type: schema.TypeString,
26+
Required: true,
27+
ForceNew: true,
28+
Description: `The name of the logging bucket. Logging automatically creates two log buckets: _Required and _Default.`,
2629
},
2730
"description": {
28-
Type: schema.TypeString,
29-
Optional: true,
30-
Computed: true,
31+
Type: schema.TypeString,
32+
Optional: true,
33+
Computed: true,
34+
Description: `An optional description for this bucket.`,
3135
},
3236
"retention_days": {
33-
Type: schema.TypeInt,
34-
Optional: true,
35-
Default: 30,
37+
Type: schema.TypeInt,
38+
Optional: true,
39+
Default: 30,
40+
Description: `Logs will be retained by default for this amount of time, after which they will automatically be deleted. The minimum retention period is 1 day. If this value is set to zero at bucket creation time, the default time of 30 days will be used.`,
3641
},
3742
"lifecycle_state": {
38-
Type: schema.TypeString,
39-
Computed: true,
43+
Type: schema.TypeString,
44+
Computed: true,
45+
Description: `The bucket's lifecycle such as active or deleted.`,
4046
},
4147
}
4248

google-beta/resource_logging_exclusion.go

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,21 +11,25 @@ import (
1111

1212
var LoggingExclusionBaseSchema = map[string]*schema.Schema{
1313
"filter": {
14-
Type: schema.TypeString,
15-
Required: true,
14+
Type: schema.TypeString,
15+
Required: true,
16+
Description: `The filter to apply when excluding logs. Only log entries that match the filter are excluded.`,
1617
},
1718
"name": {
18-
Type: schema.TypeString,
19-
Required: true,
20-
ForceNew: true,
19+
Type: schema.TypeString,
20+
Required: true,
21+
ForceNew: true,
22+
Description: `The name of the logging exclusion.`,
2123
},
2224
"description": {
23-
Type: schema.TypeString,
24-
Optional: true,
25+
Type: schema.TypeString,
26+
Optional: true,
27+
Description: `A human-readable description.`,
2528
},
2629
"disabled": {
27-
Type: schema.TypeBool,
28-
Optional: true,
30+
Type: schema.TypeBool,
31+
Optional: true,
32+
Description: `Whether this exclusion rule should be disabled or not. This defaults to false.`,
2933
},
3034
}
3135

google-beta/resource_logging_folder_bucket_config.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,10 @@ import (
99

1010
var loggingFolderBucketConfigSchema = map[string]*schema.Schema{
1111
"folder": {
12-
Type: schema.TypeString,
13-
Required: true,
14-
ForceNew: true,
12+
Type: schema.TypeString,
13+
Required: true,
14+
ForceNew: true,
15+
Description: `The parent resource that contains the logging bucket.`,
1516
},
1617
}
1718

google-beta/resource_logging_folder_sink.go

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,18 +19,20 @@ func resourceLoggingFolderSink() *schema.Resource {
1919
},
2020
}
2121
schm.Schema["folder"] = &schema.Schema{
22-
Type: schema.TypeString,
23-
Required: true,
24-
ForceNew: true,
22+
Type: schema.TypeString,
23+
Required: true,
24+
ForceNew: true,
25+
Description: `The folder to be exported to the sink. Note that either [FOLDER_ID] or "folders/[FOLDER_ID]" is accepted.`,
2526
StateFunc: func(v interface{}) string {
2627
return strings.Replace(v.(string), "folders/", "", 1)
2728
},
2829
}
2930
schm.Schema["include_children"] = &schema.Schema{
30-
Type: schema.TypeBool,
31-
Optional: true,
32-
ForceNew: true,
33-
Default: false,
31+
Type: schema.TypeBool,
32+
Optional: true,
33+
ForceNew: true,
34+
Default: false,
35+
Description: `Whether or not to include children folders in the sink export. If true, logs associated with child projects are also exported; otherwise only logs relating to the provided folder are included.`,
3436
}
3537

3638
return schm

google-beta/resource_logging_organization_bucket_config.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,10 @@ import (
99

1010
var loggingOrganizationBucketConfigSchema = map[string]*schema.Schema{
1111
"organization": {
12-
Type: schema.TypeString,
13-
Required: true,
14-
ForceNew: true,
12+
Type: schema.TypeString,
13+
Required: true,
14+
ForceNew: true,
15+
Description: `The parent resource that contains the logging bucket.`,
1516
},
1617
}
1718

google-beta/resource_logging_organization_sink.go

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,17 +19,19 @@ func resourceLoggingOrganizationSink() *schema.Resource {
1919
},
2020
}
2121
schm.Schema["org_id"] = &schema.Schema{
22-
Type: schema.TypeString,
23-
Required: true,
22+
Type: schema.TypeString,
23+
Required: true,
24+
Description: `The numeric ID of the organization to be exported to the sink.`,
2425
StateFunc: func(v interface{}) string {
2526
return strings.Replace(v.(string), "organizations/", "", 1)
2627
},
2728
}
2829
schm.Schema["include_children"] = &schema.Schema{
29-
Type: schema.TypeBool,
30-
Optional: true,
31-
ForceNew: true,
32-
Default: false,
30+
Type: schema.TypeBool,
31+
Optional: true,
32+
ForceNew: true,
33+
Default: false,
34+
Description: `Whether or not to include children organizations in the sink export. If true, logs associated with child projects are also exported; otherwise only logs relating to the provided organization are included.`,
3335
}
3436

3537
return schm

google-beta/resource_logging_project_bucket_config.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,10 @@ import (
99

1010
var loggingProjectBucketConfigSchema = map[string]*schema.Schema{
1111
"project": {
12-
Type: schema.TypeString,
13-
Required: true,
14-
ForceNew: true,
12+
Type: schema.TypeString,
13+
Required: true,
14+
ForceNew: true,
15+
Description: `The parent project that contains the logging bucket.`,
1516
},
1617
}
1718

0 commit comments

Comments
 (0)