Skip to content

Commit b9428f8

Browse files
Add capability related fields to the folder schema (#14601) (#23983)
[upstream:db59fd31d1d6eacf96a52195a197ae4a42e62493] Signed-off-by: Modular Magician <[email protected]>
1 parent 889cfbe commit b9428f8

File tree

5 files changed

+33
-0
lines changed

5 files changed

+33
-0
lines changed

.changelog/14601.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
```release-note:enhancement
2+
resourcemanager: Added `management_project` and `configured_capabilities` fields to the `google_folder` resource.
3+
```

google/services/resourcemanager/data_source_google_folder.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,15 @@ func DataSourceGoogleFolder() *schema.Resource {
7070
Type: schema.TypeBool,
7171
Computed: true,
7272
},
73+
"configured_capabilities": {
74+
Type: schema.TypeList,
75+
Computed: true,
76+
Elem: &schema.Schema{Type: schema.TypeString},
77+
},
78+
"management_project": {
79+
Type: schema.TypeString,
80+
Computed: true,
81+
},
7382
},
7483
}
7584
}

google/services/resourcemanager/resource_google_folder.go

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,17 @@ func ResourceGoogleFolder() *schema.Resource {
9494
Elem: &schema.Schema{Type: schema.TypeString},
9595
Description: `A map of resource manager tags. Resource manager tag keys and values have the same definition as resource manager tags. Keys must be in the format tagKeys/{tag_key_id}, and values are in the format tagValues/456. The field is ignored when empty. This field is only set at create time and modifying this field after creation will trigger recreation. To apply tags to an existing resource, see the google_tags_tag_value resource.`,
9696
},
97+
"configured_capabilities": {
98+
Type: schema.TypeList,
99+
Computed: true,
100+
Elem: &schema.Schema{Type: schema.TypeString},
101+
Description: `A list of capabilities that are configured for this folder.`,
102+
},
103+
"management_project": {
104+
Type: schema.TypeString,
105+
Computed: true,
106+
Description: `The Management Project associated with the folder's configured capabilities.`,
107+
},
97108
},
98109
UseJSONNumber: true,
99110
}
@@ -195,6 +206,12 @@ func resourceGoogleFolderRead(d *schema.ResourceData, meta interface{}) error {
195206
if err := d.Set("create_time", folder.CreateTime); err != nil {
196207
return fmt.Errorf("Error setting create_time: %s", err)
197208
}
209+
if err := d.Set("configured_capabilities", folder.ConfiguredCapabilities); err != nil {
210+
return fmt.Errorf("Error setting configured_capabilities: %s", err)
211+
}
212+
if err := d.Set("management_project", folder.ManagementProject); err != nil {
213+
return fmt.Errorf("Error setting management_project: %s", err)
214+
}
198215

199216
return nil
200217
}

website/docs/d/folder.html.markdown

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,3 +61,5 @@ The following attributes are exported:
6161
* `create_time` - Timestamp when the Organization was created. A timestamp in RFC3339 UTC "Zulu" format, accurate to nanoseconds. Example: "2014-10-02T15:01:23.045123456Z".
6262
* `lifecycle_state` - The Folder's current lifecycle state.
6363
* `organization` - If `lookup_organization` is enable, the resource name of the Organization that the folder belongs.
64+
* `configured_capabilities` - Optional capabilities configured for this folder.
65+
* `management_project` - Management Project associated with this folder (if capability is enabled).

website/docs/r/google_folder.html.markdown

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,8 @@ exported:
8383
* `lifecycle_state` - The lifecycle state of the folder such as `ACTIVE` or `DELETE_REQUESTED`.
8484
* `create_time` - Timestamp when the Folder was created. Assigned by the server.
8585
A timestamp in RFC3339 UTC "Zulu" format, accurate to nanoseconds. Example: "2014-10-02T15:01:23.045123456Z".
86+
* `configured_capabilities` - Optional capabilities configured for this folder.
87+
* `management_project` - Management Project associated with this folder (if capability is enabled).
8688

8789
## Import
8890

0 commit comments

Comments
 (0)