Skip to content

Commit

Permalink
add desc to schema for google_folder_organization_policy, google_orga…
Browse files Browse the repository at this point in the history
…nization_policy and google_project_organization_policy (#3668)

Co-authored-by: Edward Sun <[email protected]>
  • Loading branch information
edwardmedia and Edward Sun authored Jun 24, 2020
1 parent a3b524b commit 1befd05
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 31 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,10 @@ func resourceGoogleFolderOrganizationPolicy() *schema.Resource {
schemaOrganizationPolicy,
map[string]*schema.Schema{
"folder": {
Type: schema.TypeString,
Required: true,
ForceNew: true,
Type: schema.TypeString,
Required: true,
ForceNew: true,
Description: `The resource name of the folder to set the policy for. Its format is folders/{folder_id}.`,
},
},
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,42 +19,49 @@ var schemaOrganizationPolicy = map[string]*schema.Schema{
Required: true,
ForceNew: true,
DiffSuppressFunc: compareSelfLinkOrResourceName,
Description: `The name of the Constraint the Policy is configuring, for example, serviceuser.services.`,
},
"boolean_policy": {
Type: schema.TypeList,
Optional: true,
MaxItems: 1,
Type: schema.TypeList,
Optional: true,
MaxItems: 1,
Description: `A boolean policy is a constraint that is either enforced or not.`,
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
"enforced": {
Type: schema.TypeBool,
Required: true,
Type: schema.TypeBool,
Required: true,
Description: `If true, then the Policy is enforced. If false, then any configuration is acceptable.`,
},
},
},
},
"list_policy": {
Type: schema.TypeList,
Optional: true,
MaxItems: 1,
Type: schema.TypeList,
Optional: true,
MaxItems: 1,
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. `,
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
"allow": {
Type: schema.TypeList,
Optional: true,
MaxItems: 1,
Description: `One or the other must be set.`,
ExactlyOneOf: []string{"list_policy.0.allow", "list_policy.0.deny"},
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
"all": {
Type: schema.TypeBool,
Optional: true,
Default: false,
Description: `The policy allows or denies all values.`,
ExactlyOneOf: []string{"list_policy.0.allow.0.all", "list_policy.0.allow.0.values"},
},
"values": {
Type: schema.TypeSet,
Optional: true,
Description: `The policy can define specific values that are allowed or denied.`,
ExactlyOneOf: []string{"list_policy.0.allow.0.all", "list_policy.0.allow.0.values"},
Elem: &schema.Schema{Type: schema.TypeString},
Set: schema.HashString,
Expand All @@ -66,18 +73,21 @@ var schemaOrganizationPolicy = map[string]*schema.Schema{
Type: schema.TypeList,
Optional: true,
MaxItems: 1,
Description: `One or the other must be set.`,
ExactlyOneOf: []string{"list_policy.0.allow", "list_policy.0.deny"},
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
"all": {
Type: schema.TypeBool,
Optional: true,
Default: false,
Description: `The policy allows or denies all values.`,
ExactlyOneOf: []string{"list_policy.0.deny.0.all", "list_policy.0.deny.0.values"},
},
"values": {
Type: schema.TypeSet,
Optional: true,
Description: `The policy can define specific values that are allowed or denied.`,
ExactlyOneOf: []string{"list_policy.0.deny.0.all", "list_policy.0.deny.0.values"},
Elem: &schema.Schema{Type: schema.TypeString},
Set: schema.HashString,
Expand All @@ -86,39 +96,46 @@ var schemaOrganizationPolicy = map[string]*schema.Schema{
},
},
"suggested_value": {
Type: schema.TypeString,
Optional: true,
Computed: true,
Type: schema.TypeString,
Optional: true,
Computed: true,
Description: `The Google Cloud Console will try to default to a configuration that matches the value specified in this field.`,
},
"inherit_from_parent": {
Type: schema.TypeBool,
Optional: true,
Type: schema.TypeBool,
Optional: true,
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.`,
},
},
},
},
"version": {
Type: schema.TypeInt,
Optional: true,
Computed: true,
Type: schema.TypeInt,
Optional: true,
Computed: true,
Description: `Version of the Policy. Default version is 0.`,
},
"etag": {
Type: schema.TypeString,
Computed: true,
Type: schema.TypeString,
Computed: true,
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.`,
},
"update_time": {
Type: schema.TypeString,
Computed: true,
Type: schema.TypeString,
Computed: true,
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".`,
},
"restore_policy": {
Type: schema.TypeList,
Optional: true,
MaxItems: 1,
Type: schema.TypeList,
Optional: true,
MaxItems: 1,
Description: `A restore policy is a constraint to restore the default policy.`,
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
"default": {
Type: schema.TypeBool,
Required: true,
Type: schema.TypeBool,
Required: true,
Description: `May only be set to true. If set, then the default Policy is restored.`,
},
},
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,10 @@ func resourceGoogleProjectOrganizationPolicy() *schema.Resource {
schemaOrganizationPolicy,
map[string]*schema.Schema{
"project": {
Type: schema.TypeString,
Required: true,
ForceNew: true,
Type: schema.TypeString,
Required: true,
ForceNew: true,
Description: `The project ID.`,
},
},
),
Expand Down

0 comments on commit 1befd05

Please sign in to comment.