Skip to content

Commit c46f4ba

Browse files
modular-magicianEdward Sun
andauthored
add desc to schema for google_folder_organization_policy, google_organization_policy and google_project_organization_policy (#3668) (#2222)
Co-authored-by: Edward Sun <[email protected]> Signed-off-by: Modular Magician <[email protected]> Co-authored-by: Edward Sun <[email protected]>
1 parent a073887 commit c46f4ba

File tree

4 files changed

+53
-31
lines changed

4 files changed

+53
-31
lines changed

.changelog/3668.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_google_folder_organization_policy.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,10 @@ func resourceGoogleFolderOrganizationPolicy() *schema.Resource {
3030
schemaOrganizationPolicy,
3131
map[string]*schema.Schema{
3232
"folder": {
33-
Type: schema.TypeString,
34-
Required: true,
35-
ForceNew: true,
33+
Type: schema.TypeString,
34+
Required: true,
35+
ForceNew: true,
36+
Description: `The resource name of the folder to set the policy for. Its format is folders/{folder_id}.`,
3637
},
3738
},
3839
),

google-beta/resource_google_organization_policy.go

Lines changed: 42 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -19,42 +19,49 @@ var schemaOrganizationPolicy = map[string]*schema.Schema{
1919
Required: true,
2020
ForceNew: true,
2121
DiffSuppressFunc: compareSelfLinkOrResourceName,
22+
Description: `The name of the Constraint the Policy is configuring, for example, serviceuser.services.`,
2223
},
2324
"boolean_policy": {
24-
Type: schema.TypeList,
25-
Optional: true,
26-
MaxItems: 1,
25+
Type: schema.TypeList,
26+
Optional: true,
27+
MaxItems: 1,
28+
Description: `A boolean policy is a constraint that is either enforced or not.`,
2729
Elem: &schema.Resource{
2830
Schema: map[string]*schema.Schema{
2931
"enforced": {
30-
Type: schema.TypeBool,
31-
Required: true,
32+
Type: schema.TypeBool,
33+
Required: true,
34+
Description: `If true, then the Policy is enforced. If false, then any configuration is acceptable.`,
3235
},
3336
},
3437
},
3538
},
3639
"list_policy": {
37-
Type: schema.TypeList,
38-
Optional: true,
39-
MaxItems: 1,
40+
Type: schema.TypeList,
41+
Optional: true,
42+
MaxItems: 1,
43+
Description: `A policy that can define specific values that are allowed or denied for the given constraint. It can also be used to allow or deny all values. `,
4044
Elem: &schema.Resource{
4145
Schema: map[string]*schema.Schema{
4246
"allow": {
4347
Type: schema.TypeList,
4448
Optional: true,
4549
MaxItems: 1,
50+
Description: `One or the other must be set.`,
4651
ExactlyOneOf: []string{"list_policy.0.allow", "list_policy.0.deny"},
4752
Elem: &schema.Resource{
4853
Schema: map[string]*schema.Schema{
4954
"all": {
5055
Type: schema.TypeBool,
5156
Optional: true,
5257
Default: false,
58+
Description: `The policy allows or denies all values.`,
5359
ExactlyOneOf: []string{"list_policy.0.allow.0.all", "list_policy.0.allow.0.values"},
5460
},
5561
"values": {
5662
Type: schema.TypeSet,
5763
Optional: true,
64+
Description: `The policy can define specific values that are allowed or denied.`,
5865
ExactlyOneOf: []string{"list_policy.0.allow.0.all", "list_policy.0.allow.0.values"},
5966
Elem: &schema.Schema{Type: schema.TypeString},
6067
Set: schema.HashString,
@@ -66,18 +73,21 @@ var schemaOrganizationPolicy = map[string]*schema.Schema{
6673
Type: schema.TypeList,
6774
Optional: true,
6875
MaxItems: 1,
76+
Description: `One or the other must be set.`,
6977
ExactlyOneOf: []string{"list_policy.0.allow", "list_policy.0.deny"},
7078
Elem: &schema.Resource{
7179
Schema: map[string]*schema.Schema{
7280
"all": {
7381
Type: schema.TypeBool,
7482
Optional: true,
7583
Default: false,
84+
Description: `The policy allows or denies all values.`,
7685
ExactlyOneOf: []string{"list_policy.0.deny.0.all", "list_policy.0.deny.0.values"},
7786
},
7887
"values": {
7988
Type: schema.TypeSet,
8089
Optional: true,
90+
Description: `The policy can define specific values that are allowed or denied.`,
8191
ExactlyOneOf: []string{"list_policy.0.deny.0.all", "list_policy.0.deny.0.values"},
8292
Elem: &schema.Schema{Type: schema.TypeString},
8393
Set: schema.HashString,
@@ -86,39 +96,46 @@ var schemaOrganizationPolicy = map[string]*schema.Schema{
8696
},
8797
},
8898
"suggested_value": {
89-
Type: schema.TypeString,
90-
Optional: true,
91-
Computed: true,
99+
Type: schema.TypeString,
100+
Optional: true,
101+
Computed: true,
102+
Description: `The Google Cloud Console will try to default to a configuration that matches the value specified in this field.`,
92103
},
93104
"inherit_from_parent": {
94-
Type: schema.TypeBool,
95-
Optional: true,
105+
Type: schema.TypeBool,
106+
Optional: true,
107+
Description: `If set to true, the values from the effective Policy of the parent resource are inherited, meaning the values set in this Policy are added to the values inherited up the hierarchy.`,
96108
},
97109
},
98110
},
99111
},
100112
"version": {
101-
Type: schema.TypeInt,
102-
Optional: true,
103-
Computed: true,
113+
Type: schema.TypeInt,
114+
Optional: true,
115+
Computed: true,
116+
Description: `Version of the Policy. Default version is 0.`,
104117
},
105118
"etag": {
106-
Type: schema.TypeString,
107-
Computed: true,
119+
Type: schema.TypeString,
120+
Computed: true,
121+
Description: `The etag of the organization policy. etag is used for optimistic concurrency control as a way to help prevent simultaneous updates of a policy from overwriting each other.`,
108122
},
109123
"update_time": {
110-
Type: schema.TypeString,
111-
Computed: true,
124+
Type: schema.TypeString,
125+
Computed: true,
126+
Description: `The timestamp in RFC3339 UTC "Zulu" format, accurate to nanoseconds, representing when the variable was last updated. Example: "2016-10-09T12:33:37.578138407Z".`,
112127
},
113128
"restore_policy": {
114-
Type: schema.TypeList,
115-
Optional: true,
116-
MaxItems: 1,
129+
Type: schema.TypeList,
130+
Optional: true,
131+
MaxItems: 1,
132+
Description: `A restore policy is a constraint to restore the default policy.`,
117133
Elem: &schema.Resource{
118134
Schema: map[string]*schema.Schema{
119135
"default": {
120-
Type: schema.TypeBool,
121-
Required: true,
136+
Type: schema.TypeBool,
137+
Required: true,
138+
Description: `May only be set to true. If set, then the default Policy is restored.`,
122139
},
123140
},
124141
},

google-beta/resource_google_project_organization_policy.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,10 @@ func resourceGoogleProjectOrganizationPolicy() *schema.Resource {
3030
schemaOrganizationPolicy,
3131
map[string]*schema.Schema{
3232
"project": {
33-
Type: schema.TypeString,
34-
Required: true,
35-
ForceNew: true,
33+
Type: schema.TypeString,
34+
Required: true,
35+
ForceNew: true,
36+
Description: `The project ID.`,
3637
},
3738
},
3839
),

0 commit comments

Comments
 (0)