Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

removed computed from encryption_key and added encryption_type for is_volume #3057

Merged
merged 1 commit into from
Sep 8, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions ibm/data_source_ibm_is_volume.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,12 @@ func dataSourceIBMISVolume() *schema.Resource {
Description: "Volume encryption key info",
},

isVolumeEncryptionType: {
Type: schema.TypeString,
Computed: true,
Description: "Volume encryption type info",
},

isVolumeCapacity: {
Type: schema.TypeInt,
Computed: true,
Expand Down Expand Up @@ -201,6 +207,9 @@ func volumeGet(d *schema.ResourceData, meta interface{}, name string) error {
if vol.EncryptionKey != nil {
d.Set(isVolumeEncryptionKey, vol.EncryptionKey.CRN)
}
if vol.Encryption != nil {
d.Set(isVolumeEncryptionType, vol.Encryption)
}
if vol.SourceSnapshot != nil {
d.Set(isVolumeSourceSnapshot, *vol.SourceSnapshot.ID)
}
Expand Down
11 changes: 10 additions & 1 deletion ibm/resource_ibm_is_volume.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ const (
isVolumeProfileName = "profile"
isVolumeZone = "zone"
isVolumeEncryptionKey = "encryption_key"
isVolumeEncryptionType = "encryption_type"
isVolumeCapacity = "capacity"
isVolumeIops = "iops"
isVolumeCrn = "crn"
Expand Down Expand Up @@ -84,11 +85,16 @@ func resourceIBMISVolume() *schema.Resource {
isVolumeEncryptionKey: {
Type: schema.TypeString,
Optional: true,
Computed: true,
ForceNew: true,
Description: "Volume encryption key info",
},

isVolumeEncryptionType: {
Type: schema.TypeString,
Computed: true,
Description: "Volume encryption type info",
},

isVolumeCapacity: {
Type: schema.TypeInt,
Optional: true,
Expand Down Expand Up @@ -333,6 +339,9 @@ func volGet(d *schema.ResourceData, meta interface{}, id string) error {
if vol.EncryptionKey != nil {
d.Set(isVolumeEncryptionKey, vol.EncryptionKey.CRN)
}
if vol.Encryption != nil {
d.Set(isVolumeEncryptionType, vol.Encryption)
}
d.Set(isVolumeIops, *vol.Iops)
d.Set(isVolumeCapacity, *vol.Capacity)
d.Set(isVolumeCrn, *vol.CRN)
Expand Down
1 change: 1 addition & 0 deletions website/docs/d/is_volume.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ In addition to all argument reference list, you can access the following attribu

- `capacity` - (String) The capacity of the volume in gigabytes.
- `encryption_key` - (String) The key to use for encrypting this volume.
- `encryption_type` - (String) The type of ecryption used in the volume [**provider_managed**, **user_managed**].
- `iops` - (String) The bandwidth for the volume.
- `profile` - (String) The profile to use for this volume.
- `resource_group` - (String) The resource group ID for this volume.
Expand Down
1 change: 1 addition & 0 deletions website/docs/r/is_volume.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ Review the argument references that you can specify for your resource.
## Attribute reference
In addition to all argument reference list, you can access the following attribute reference after your resource is created.

- `encryption_type` - (String) The type of ecryption used in the volume [**provider_managed**, **user_managed**].
- `id` - (String) The unique identifier of the volume.
- `source_snapshot` - ID of the snapshot, if volume was created from it.
- `status` - (String) The status of volume. Supported values are **available**, **failed**, **pending**, **unusable**, or **pending_deletion**.
Expand Down