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

support for snapshot crn #5399

Merged
merged 7 commits into from
Jun 18, 2024
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
37 changes: 28 additions & 9 deletions ibm/service/vpc/resource_ibm_is_instance.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ const (
isInstanceZone = "zone"
isInstanceBootVolume = "boot_volume"
isInstanceVolumeSnapshot = "snapshot"
isInstanceVolumeSnapshotCrn = "snapshot_crn"
isInstanceSourceTemplate = "instance_template"
isInstanceBandwidth = "bandwidth"
isInstanceTotalVolumeBandwidth = "total_volume_bandwidth"
Expand Down Expand Up @@ -217,8 +218,8 @@ func ResourceIBMISInstance() *schema.Resource {
Type: schema.TypeString,
ForceNew: true,
Optional: true,
AtLeastOneOf: []string{isInstanceImage, isInstanceSourceTemplate, "boot_volume.0.snapshot", "catalog_offering.0.offering_crn", "catalog_offering.0.version_crn", "boot_volume.0.volume_id"},
ConflictsWith: []string{"boot_volume.0.snapshot", "boot_volume.0.volume_id"},
AtLeastOneOf: []string{isInstanceImage, isInstanceSourceTemplate, "boot_volume.0.snapshot", "boot_volume.0.snapshot_crn", "catalog_offering.0.offering_crn", "catalog_offering.0.version_crn", "boot_volume.0.volume_id"},
ConflictsWith: []string{"boot_volume.0.snapshot", "boot_volume.0.snapshot_crn", "boot_volume.0.volume_id"},
Description: "Id of the instance template",
},
isInstanceZone: {
Expand Down Expand Up @@ -1090,8 +1091,8 @@ func ResourceIBMISInstance() *schema.Resource {
ForceNew: true,
Computed: true,
Optional: true,
ConflictsWith: []string{"boot_volume.0.snapshot", "catalog_offering.0.offering_crn", "catalog_offering.0.version_crn", "boot_volume.0.volume_id"},
AtLeastOneOf: []string{isInstanceImage, isInstanceSourceTemplate, "boot_volume.0.snapshot", "catalog_offering.0.offering_crn", "catalog_offering.0.version_crn", "boot_volume.0.volume_id"},
ConflictsWith: []string{"boot_volume.0.snapshot", "boot_volume.0.snapshot_crn", "catalog_offering.0.offering_crn", "catalog_offering.0.version_crn", "boot_volume.0.volume_id"},
AtLeastOneOf: []string{isInstanceImage, isInstanceSourceTemplate, "boot_volume.0.snapshot", "boot_volume.0.snapshot_crn", "catalog_offering.0.offering_crn", "catalog_offering.0.version_crn", "boot_volume.0.volume_id"},
RequiredWith: []string{isInstanceZone, isInstanceKeys, isInstanceVPC, isInstanceProfile},
Description: "image id",
},
Expand All @@ -1109,8 +1110,8 @@ func ResourceIBMISInstance() *schema.Resource {
ForceNew: true,
Computed: true,
RequiredWith: []string{isInstanceZone, isInstanceProfile, isInstanceKeys, isInstanceVPC},
AtLeastOneOf: []string{isInstanceImage, isInstanceSourceTemplate, "boot_volume.0.volume_id", "boot_volume.0.snapshot", "catalog_offering.0.offering_crn", "catalog_offering.0.version_crn"},
ConflictsWith: []string{isInstanceImage, isInstanceSourceTemplate, "boot_volume.0.snapshot", "boot_volume.0.name", "boot_volume.0.encryption", "catalog_offering.0.offering_crn", "catalog_offering.0.version_crn"},
AtLeastOneOf: []string{isInstanceImage, isInstanceSourceTemplate, "boot_volume.0.volume_id", "boot_volume.0.snapshot", "boot_volume.0.snapshot_crn", "catalog_offering.0.offering_crn", "catalog_offering.0.version_crn"},
ConflictsWith: []string{isInstanceImage, isInstanceSourceTemplate, "boot_volume.0.snapshot", "boot_volume.0.snapshot_crn", "boot_volume.0.name", "boot_volume.0.encryption", "catalog_offering.0.offering_crn", "catalog_offering.0.version_crn"},
Description: "The unique identifier for this volume",
},
isInstanceVolAttVolAutoDelete: {
Expand All @@ -1129,8 +1130,17 @@ func ResourceIBMISInstance() *schema.Resource {
isInstanceVolumeSnapshot: {
Type: schema.TypeString,
RequiredWith: []string{isInstanceZone, isInstanceProfile, isInstanceKeys, isInstanceVPC},
AtLeastOneOf: []string{isInstanceImage, isInstanceSourceTemplate, "boot_volume.0.snapshot", "catalog_offering.0.offering_crn", "catalog_offering.0.version_crn", "boot_volume.0.volume_id"},
ConflictsWith: []string{isInstanceImage, isInstanceSourceTemplate, "catalog_offering.0.offering_crn", "catalog_offering.0.version_crn", "boot_volume.0.volume_id"},
AtLeastOneOf: []string{isInstanceImage, isInstanceSourceTemplate, "boot_volume.0.snapshot", "boot_volume.0.snapshot_crn", "catalog_offering.0.offering_crn", "catalog_offering.0.version_crn", "boot_volume.0.volume_id"},
ConflictsWith: []string{isInstanceImage, isInstanceSourceTemplate, "catalog_offering.0.offering_crn", "catalog_offering.0.version_crn", "boot_volume.0.volume_id", "boot_volume.0.snapshot_crn"},
Optional: true,
ForceNew: true,
Computed: true,
},
isInstanceVolumeSnapshotCrn: {
Type: schema.TypeString,
RequiredWith: []string{isInstanceZone, isInstanceProfile, isInstanceKeys, isInstanceVPC},
AtLeastOneOf: []string{isInstanceImage, isInstanceSourceTemplate, "boot_volume.0.snapshot", "boot_volume.0.snapshot_crn", "catalog_offering.0.offering_crn", "catalog_offering.0.version_crn", "boot_volume.0.volume_id"},
ConflictsWith: []string{isInstanceImage, isInstanceSourceTemplate, "catalog_offering.0.offering_crn", "catalog_offering.0.version_crn", "boot_volume.0.volume_id", "boot_volume.0.snapshot"},
Optional: true,
ForceNew: true,
Computed: true,
Expand Down Expand Up @@ -3070,6 +3080,13 @@ func instanceCreateBySnapshot(d *schema.ResourceData, meta interface{}, profile,
ID: &snapshotIdStr,
}
}
snapshotCrn, ok := bootvol[isInstanceVolumeSnapshotCrn]
snapshotCrnStr := snapshotCrn.(string)
if snapshotCrnStr != "" && ok {
volTemplate.SourceSnapshot = &vpcv1.SnapshotIdentity{
CRN: &snapshotCrnStr,
}
}
deleteboolIntf := bootvol[isInstanceVolAttVolAutoDelete]
deletebool := deleteboolIntf.(bool)
instanceproto.BootVolumeAttachment = &vpcv1.VolumeAttachmentPrototypeInstanceBySourceSnapshotContext{
Expand Down Expand Up @@ -3795,6 +3812,7 @@ func resourceIBMisInstanceCreate(d *schema.ResourceData, meta interface{}) error
zone := d.Get(isInstanceZone).(string)
image := d.Get(isInstanceImage).(string)
snapshot := d.Get("boot_volume.0.snapshot").(string)
snapshotcrn := d.Get("boot_volume.0.snapshot_crn").(string)
volume := d.Get("boot_volume.0.volume_id").(string)
template := d.Get(isInstanceSourceTemplate).(string)
if catalogOfferingOk, ok := d.GetOk(isInstanceCatalogOffering); ok {
Expand All @@ -3811,7 +3829,7 @@ func resourceIBMisInstanceCreate(d *schema.ResourceData, meta interface{}) error
if err != nil {
return err
}
} else if snapshot != "" {
} else if snapshot != "" || snapshotcrn != "" {
err := instanceCreateBySnapshot(d, meta, profile, name, vpcID, zone)
if err != nil {
return err
Expand Down Expand Up @@ -4353,6 +4371,7 @@ func instanceGet(d *schema.ResourceData, meta interface{}, id string) error {
}
if vol.SourceSnapshot != nil {
bootVol[isInstanceVolumeSnapshot] = vol.SourceSnapshot.ID
bootVol[isInstanceVolumeSnapshotCrn] = vol.SourceSnapshot.CRN
}
if vol.UserTags != nil {
bootVol[isInstanceBootVolumeTags] = vol.UserTags
Expand Down
96 changes: 96 additions & 0 deletions ibm/service/vpc/resource_ibm_is_instance_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1003,6 +1003,44 @@ ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCKVmnMOlHKcZK8tpt3MP1lqOLAcqcJzhsvJcjscgVE
},
})
}
func TestAccIBMISInstanceSnapshotRestore_crn(t *testing.T) {
var instance, instanceRestore string
vpcname := fmt.Sprintf("tf-vpc-%d", acctest.RandIntRange(10, 100))
name := fmt.Sprintf("tf-instnace-%d", acctest.RandIntRange(10, 100))
subnetname := fmt.Sprintf("tf-subnet-%d", acctest.RandIntRange(10, 100))
publicKey := strings.TrimSpace(`
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCKVmnMOlHKcZK8tpt3MP1lqOLAcqcJzhsvJcjscgVERRN7/9484SOBJ3HSKxxNG5JN8owAjy5f9yYwcUg+JaUVuytn5Pv3aeYROHGGg+5G346xaq3DAwX6Y5ykr2fvjObgncQBnuU5KHWCECO/4h8uWuwh/kfniXPVjFToc+gnkqA+3RKpAecZhFXwfalQ9mMuYGFxn+fwn8cYEApsJbsEmb0iJwPiZ5hjFC8wREuiTlhPHDgkBLOiycd20op2nXzDbHfCHInquEe/gYxEitALONxm0swBOwJZwlTDOB7C6y2dzlrtxr1L59m7pCkWI4EtTRLvleehBoj3u7jB4usR
`)
sshname := fmt.Sprintf("tf-ssh-%d", acctest.RandIntRange(10, 100))
snapshot := fmt.Sprintf("tf-snapshot-%d", acctest.RandIntRange(10, 100))
vsiRestore := fmt.Sprintf("tf-instancerestore-%d", acctest.RandIntRange(10, 100))
resource.Test(t, resource.TestCase{
PreCheck: func() { acc.TestAccPreCheck(t) },
Providers: acc.TestAccProviders,
CheckDestroy: testAccCheckIBMISInstanceDestroy,
Steps: []resource.TestStep{
{
Config: testAccCheckIBMISInstanceSnapshotRestoreCrnConfig(vpcname, subnetname, sshname, publicKey, name, snapshot, vsiRestore),
Check: resource.ComposeTestCheckFunc(
testAccCheckIBMISInstanceExists("ibm_is_instance.testacc_instance", instance),
testAccCheckIBMISInstanceExists("ibm_is_instance.testacc_instance_restore", instanceRestore),
resource.TestCheckResourceAttr(
"ibm_is_instance.testacc_instance", "name", name),
resource.TestCheckResourceAttr(
"ibm_is_instance.testacc_instance", "zone", acc.ISZoneName),
resource.TestCheckResourceAttr(
"ibm_is_snapshot.testacc_snapshot", "name", snapshot),
resource.TestCheckResourceAttr(
"ibm_is_instance.testacc_instance_restore", "zone", acc.ISZoneName),
resource.TestCheckResourceAttr(
"ibm_is_instance.testacc_instance_restore", "name", vsiRestore),
resource.TestCheckResourceAttr(
"ibm_is_instance.testacc_instance_restore", "boot_volume.0.name", "boot-restore"),
),
},
},
})
}

func TestAccIBMISInstanceSnapshotRestore_forcenew(t *testing.T) {
var instance, instanceRestore string
Expand Down Expand Up @@ -1788,6 +1826,64 @@ func testAccCheckIBMISInstanceSnapshotRestoreConfig(vpcname, subnetname, sshname
}
`, vpcname, subnetname, acc.ISZoneName, sshname, publicKey, name, acc.IsImage, acc.InstanceProfileName, acc.ISZoneName, snapshot, insRestore, acc.InstanceProfileName, acc.ISZoneName)
}
func testAccCheckIBMISInstanceSnapshotRestoreCrnConfig(vpcname, subnetname, sshname, publicKey, name, snapshot, insRestore string) string {
return fmt.Sprintf(`
resource "ibm_is_vpc" "testacc_vpc" {
name = "%s"
}

resource "ibm_is_subnet" "testacc_subnet" {
name = "%s"
vpc = ibm_is_vpc.testacc_vpc.id
zone = "%s"
total_ipv4_address_count = 16
}

resource "ibm_is_ssh_key" "testacc_sshkey" {
name = "%s"
public_key = "%s"
}

resource "ibm_is_instance" "testacc_instance" {
name = "%s"
image = "%s"
profile = "%s"
primary_network_interface {
subnet = ibm_is_subnet.testacc_subnet.id
}
vpc = ibm_is_vpc.testacc_vpc.id
zone = "%s"
keys = [ibm_is_ssh_key.testacc_sshkey.id]
network_interfaces {
subnet = ibm_is_subnet.testacc_subnet.id
name = "eth1"
}
}
resource "ibm_is_snapshot" "testacc_snapshot" {
name = "%s"
source_volume = ibm_is_instance.testacc_instance.volume_attachments[0].volume_id
}

resource "ibm_is_instance" "testacc_instance_restore" {
name = "%s"
profile = "%s"
boot_volume {
name = "boot-restore"
snapshot_crn = ibm_is_snapshot.testacc_snapshot.crn
}
primary_network_interface {
subnet = ibm_is_subnet.testacc_subnet.id
}
vpc = ibm_is_vpc.testacc_vpc.id
zone = "%s"
keys = [ibm_is_ssh_key.testacc_sshkey.id]
network_interfaces {
subnet = ibm_is_subnet.testacc_subnet.id
name = "eth1"
}
}
`, vpcname, subnetname, acc.ISZoneName, sshname, publicKey, name, acc.IsImage, acc.InstanceProfileName, acc.ISZoneName, snapshot, insRestore, acc.InstanceProfileName, acc.ISZoneName)
}

func testAccCheckIBMISInstanceSnapshotRestoreForceNewConfig(vpcname, subnetname, sshname, publicKey, name, name2, name3, insRestore string) string {
return fmt.Sprintf(`
Expand Down
30 changes: 25 additions & 5 deletions ibm/service/vpc/resource_ibm_is_instance_volume_attachment.go
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ func ResourceIBMISInstanceVolumeAttachment() *schema.Resource {
Type: schema.TypeInt,
Optional: true,
Computed: true,
AtLeastOneOf: []string{isInstanceVolAttVol, isInstanceVolCapacity, isInstanceVolumeSnapshot},
AtLeastOneOf: []string{isInstanceVolAttVol, isInstanceVolCapacity, isInstanceVolumeSnapshot, isInstanceVolumeSnapshotCrn},
ConflictsWith: []string{isInstanceVolAttVol},
ValidateFunc: validate.InvokeValidator("ibm_is_instance_volume_attachment", isInstanceVolCapacity),
Description: "The capacity of the volume in gigabytes. The specified minimum and maximum capacity values for creating or updating volumes may expand in the future.",
Expand All @@ -160,9 +160,18 @@ func ResourceIBMISInstanceVolumeAttachment() *schema.Resource {
Optional: true,
Computed: true,
ForceNew: true,
AtLeastOneOf: []string{isInstanceVolAttVol, isInstanceVolCapacity, isInstanceVolumeSnapshot},
ConflictsWith: []string{isInstanceVolAttVol},
Description: "The snapshot of the volume to be attached",
AtLeastOneOf: []string{isInstanceVolAttVol, isInstanceVolCapacity, isInstanceVolumeSnapshot, isInstanceVolumeSnapshotCrn},
ConflictsWith: []string{isInstanceVolAttVol, isInstanceVolumeSnapshotCrn},
Description: "The snapshot ID of the volume to be attached",
},
isInstanceVolumeSnapshotCrn: {
Type: schema.TypeString,
Optional: true,
Computed: true,
ForceNew: true,
AtLeastOneOf: []string{isInstanceVolAttVol, isInstanceVolCapacity, isInstanceVolumeSnapshot, isInstanceVolumeSnapshotCrn},
ConflictsWith: []string{isInstanceVolAttVol, isInstanceVolumeSnapshot},
Description: "The snapshot crn of the volume to be attached",
},
isInstanceVolumeAttVolumeReferenceCrn: {
Type: schema.TypeString,
Expand Down Expand Up @@ -312,12 +321,19 @@ func instanceVolAttachmentCreate(d *schema.ResourceData, meta interface{}, insta
}
}
volSnapshotStr := ""
volSnapshotCrnStr := ""
if volSnapshot, ok := d.GetOk(isInstanceVolumeSnapshot); ok {
volSnapshotStr = volSnapshot.(string)
volProtoVol.SourceSnapshot = &vpcv1.SnapshotIdentity{
ID: &volSnapshotStr,
}
}
if volSnapshotCrn, ok := d.GetOk(isInstanceVolumeSnapshotCrn); ok {
volSnapshotCrnStr = volSnapshotCrn.(string)
volProtoVol.SourceSnapshot = &vpcv1.SnapshotIdentity{
CRN: &volSnapshotCrnStr,
}
}
encryptionCRNStr := ""
if encryptionCRN, ok := d.GetOk(isInstanceVolEncryptionKey); ok {
encryptionCRNStr = encryptionCRN.(string)
Expand All @@ -326,7 +342,10 @@ func instanceVolAttachmentCreate(d *schema.ResourceData, meta interface{}, insta
}
}
var snapCapacity int64
if volSnapshotStr != "" {
if volSnapshotStr != "" || volSnapshotCrnStr != "" {
if volSnapshotStr == "" {
volSnapshotStr = volSnapshotCrnStr[strings.LastIndex(volSnapshotCrnStr, ":")+1:]
}
snapshotGet, _, err := sess.GetSnapshot(&vpcv1.GetSnapshotOptions{
ID: &volSnapshotStr,
})
Expand Down Expand Up @@ -475,6 +494,7 @@ func instanceVolumeAttachmentGet(d *schema.ResourceData, meta interface{}, insta
}
if volumeDetail.SourceSnapshot != nil {
d.Set(isInstanceVolumeSnapshot, *volumeDetail.SourceSnapshot.ID)
d.Set(isInstanceVolumeSnapshotCrn, *volumeDetail.SourceSnapshot.CRN)
}
return nil
}
Expand Down
80 changes: 80 additions & 0 deletions ibm/service/vpc/resource_ibm_is_instance_volume_attachment_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,41 @@ ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCKVmnMOlHKcZK8tpt3MP1lqOLAcqcJzhsvJcjscgVE
},
})
}
func TestAccIBMISInstanceVolumeAttachment_crn(t *testing.T) {
var instanceVolAtt string
vpcname := fmt.Sprintf("tf-vpc-%d", acctest.RandIntRange(10, 100))
name := fmt.Sprintf("tf-instnace-%d", acctest.RandIntRange(10, 100))
subnetname := fmt.Sprintf("tf-subnet-%d", acctest.RandIntRange(10, 100))
publicKey := strings.TrimSpace(`
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCKVmnMOlHKcZK8tpt3MP1lqOLAcqcJzhsvJcjscgVERRN7/9484SOBJ3HSKxxNG5JN8owAjy5f9yYwcUg+JaUVuytn5Pv3aeYROHGGg+5G346xaq3DAwX6Y5ykr2fvjObgncQBnuU5KHWCECO/4h8uWuwh/kfniXPVjFToc+gnkqA+3RKpAecZhFXwfalQ9mMuYGFxn+fwn8cYEApsJbsEmb0iJwPiZ5hjFC8wREuiTlhPHDgkBLOiycd20op2nXzDbHfCHInquEe/gYxEitALONxm0swBOwJZwlTDOB7C6y2dzlrtxr1L59m7pCkWI4EtTRLvleehBoj3u7jB4usR
`)
sshname := fmt.Sprintf("tf-ssh-%d", acctest.RandIntRange(10, 100))
attName := fmt.Sprintf("tf-volatt-%d", acctest.RandIntRange(10, 100))
autoDelete := true
volName := fmt.Sprintf("tf-vol-%d", acctest.RandIntRange(10, 100))

resource.Test(t, resource.TestCase{
PreCheck: func() { acc.TestAccPreCheck(t) },
Providers: acc.TestAccProviders,
CheckDestroy: testAccCheckIBMISInstanceDestroy,
Steps: []resource.TestStep{
{
Config: testAccCheckIBMISInstanceVolumeAttachmentCrnConfig(vpcname, subnetname, sshname, publicKey, name, attName, volName, autoDelete),
Check: resource.ComposeTestCheckFunc(
testAccCheckIBMISInstanceVolumeAttachmentExists("ibm_is_instance_volume_attachment.testacc_att", instanceVolAtt),
resource.TestCheckResourceAttr(
"ibm_is_instance_volume_attachment.testacc_att", "name", attName),
resource.TestCheckResourceAttr(
"ibm_is_instance_volume_attachment.testacc_att", "delete_volume_on_instance_delete", fmt.Sprintf("%t", autoDelete)),
resource.TestCheckResourceAttrSet(
"ibm_is_instance_volume_attachment.testacc_att", "capacity"),
resource.TestCheckResourceAttrSet(
"ibm_is_instance_volume_attachment.testacc_att", "iops"),
),
},
},
})
}

func TestAccIBMISInstanceVolumeAttachment_userTag(t *testing.T) {
var instanceVolAtt string
Expand Down Expand Up @@ -242,6 +277,51 @@ func testAccCheckIBMISInstanceVolumeAttachmentConfig(vpcname, subnetname, sshnam
`, vpcname, subnetname, acc.ISZoneName, sshname, publicKey, name, acc.IsImage, acc.InstanceProfileName, acc.ISZoneName, attName, capacity, iops, autoDelete, volName)
}

func testAccCheckIBMISInstanceVolumeAttachmentCrnConfig(vpcname, subnetname, sshname, publicKey, name, attName, volName string, autoDelete bool) string {
return fmt.Sprintf(`
resource "ibm_is_vpc" "testacc_vpc" {
name = "%s"
}
resource "ibm_is_subnet" "testacc_subnet" {
name = "%s"
vpc = ibm_is_vpc.testacc_vpc.id
zone = "%s"
total_ipv4_address_count = 16
}
resource "ibm_is_ssh_key" "testacc_sshkey" {
name = "%s"
public_key = "%s"
}
resource "ibm_is_instance" "testacc_instance" {
name = "%s"
image = "%s"
profile = "%s"
primary_network_interface {
subnet = ibm_is_subnet.testacc_subnet.id
}
vpc = ibm_is_vpc.testacc_vpc.id
zone = "%s"
keys = [ibm_is_ssh_key.testacc_sshkey.id]
network_interfaces {
subnet = ibm_is_subnet.testacc_subnet.id
name = "eth1"
}
}
resource "ibm_is_snapshot" "testacc_snapshot" {
name = "tf-test-snapshot"
source_volume = ibm_is_instance.testacc_instance.volume_attachments[0].volume_id
}
resource "ibm_is_instance_volume_attachment" "testacc_att" {
instance = ibm_is_instance.testacc_instance.id
name = "%s"
profile = "general-purpose"
snapshot_crn = ibm_is_snapshot.testacc_snapshot.crn
delete_volume_on_instance_delete = %t
volume_name = "%s"
}
`, vpcname, subnetname, acc.ISZoneName, sshname, publicKey, name, acc.IsImage, acc.InstanceProfileName, acc.ISZoneName, attName, autoDelete, volName)
}

func testAccCheckIBMISInstanceVolumeAttachmentUsertagConfig(vpcname, subnetname, sshname, publicKey, name, attName, volName, usertag string, autoDelete bool, capacity, iops int64) string {
return fmt.Sprintf(`
resource "ibm_is_vpc" "testacc_vpc" {
Expand Down
2 changes: 1 addition & 1 deletion ibm/service/vpc/resource_ibm_is_snapshot_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ func testAccCheckIBMISSnapshotConfig(vpcname, subnetname, sshname, publicKey, vo
resource "ibm_is_snapshot" "testacc_snapshot" {
name = "%s"
source_volume = ibm_is_instance.testacc_instance.volume_attachments[0].volume_id
}`, vpcname, subnetname, acc.ISZoneName, sshname, publicKey, name, acc.IsImage, acc.InstanceProfileName, acc.ISZoneName, sname)
}`, vpcname, subnetname, acc.ISZoneName, sshname, publicKey, name, acc.IsImage, acc.InstanceProfileName, acc.ISZoneName, sname)

}
func testAccCheckIBMISSnapshotEncryptedConfig(vpcname, subnetname, sshname, publicKey, volname, name, sname string) string {
Expand Down
Loading
Loading