Skip to content

Commit 1b6c986

Browse files
tete17tbroden84
andauthored
Update Terraform Plugin SDK to V2 (#261)
This will update the Terraform Plugin SDK from V1 to V2 major release and bump the SDK to the latest version (v2.33.0). The update also changes the requirements: * Drops support for terraform <= 0.11. * Requires Go >= 1.21 * Supports use for schema version v5. All Go-VCR tests have been re-recorded. Closes #140 --------- Co-authored-by: Tobias Brodén <tobias@84codes.com>
1 parent e62fb38 commit 1b6c986

File tree

73 files changed

+5352
-5779
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

73 files changed

+5352
-5779
lines changed

cloudamqp/data_source_cloudamqp_account.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import (
44
"fmt"
55

66
"github.com/84codes/go-api/api"
7-
"github.com/hashicorp/terraform-plugin-sdk/helper/schema"
7+
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
88
)
99

1010
func dataSourceAccount() *schema.Resource {

cloudamqp/data_source_cloudamqp_account_vpcs.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import (
44
"fmt"
55

66
"github.com/84codes/go-api/api"
7-
"github.com/hashicorp/terraform-plugin-sdk/helper/schema"
7+
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
88
)
99

1010
func dataSourceAccountVpcs() *schema.Resource {

cloudamqp/data_source_cloudamqp_alarm.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@ import (
55
"strconv"
66

77
"github.com/84codes/go-api/api"
8-
"github.com/hashicorp/terraform-plugin-sdk/helper/schema"
8+
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
99
)
1010

1111
func dataSourceAlarm() *schema.Resource {
1212
return &schema.Resource{
1313
Read: dataSourceAlarmRead,
1414
Importer: &schema.ResourceImporter{
15-
State: schema.ImportStatePassthrough,
15+
StateContext: schema.ImportStatePassthroughContext,
1616
},
1717
Schema: map[string]*schema.Schema{
1818
"instance_id": {
@@ -26,10 +26,10 @@ func dataSourceAlarm() *schema.Resource {
2626
Description: "Alarm identifier",
2727
},
2828
"type": {
29-
Type: schema.TypeString,
30-
Optional: true,
31-
Description: "Type of the alarm",
32-
ValidateFunc: validateAlarmType(),
29+
Type: schema.TypeString,
30+
Optional: true,
31+
Description: "Type of the alarm",
32+
ValidateDiagFunc: validateAlarmType(),
3333
},
3434
"enabled": {
3535
Type: schema.TypeBool,

cloudamqp/data_source_cloudamqp_credentials.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ package cloudamqp
22

33
import (
44
"github.com/84codes/go-api/api"
5-
"github.com/hashicorp/terraform-plugin-sdk/helper/schema"
5+
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
66

77
"fmt"
88
)

cloudamqp/data_source_cloudamqp_instance.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@ import (
55
"strconv"
66

77
"github.com/84codes/go-api/api"
8-
"github.com/hashicorp/terraform-plugin-sdk/helper/schema"
8+
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
99
)
1010

1111
func dataSourceInstance() *schema.Resource {
1212
return &schema.Resource{
1313
Read: dataSourceInstanceRead,
1414
Importer: &schema.ResourceImporter{
15-
State: schema.ImportStatePassthrough,
15+
StateContext: schema.ImportStatePassthroughContext,
1616
},
1717
Schema: map[string]*schema.Schema{
1818
"instance_id": {

cloudamqp/data_source_cloudamqp_nodes.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import (
55
"strconv"
66

77
"github.com/84codes/go-api/api"
8-
"github.com/hashicorp/terraform-plugin-sdk/helper/schema"
8+
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
99
)
1010

1111
func dataSourceNodes() *schema.Resource {

cloudamqp/data_source_cloudamqp_notification.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@ import (
55
"strconv"
66

77
"github.com/84codes/go-api/api"
8-
"github.com/hashicorp/terraform-plugin-sdk/helper/schema"
8+
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
99
)
1010

1111
func dataSourceNotification() *schema.Resource {
1212
return &schema.Resource{
1313
Read: dataSourceNotificationRead,
1414
Importer: &schema.ResourceImporter{
15-
State: schema.ImportStatePassthrough,
15+
StateContext: schema.ImportStatePassthroughContext,
1616
},
1717
Schema: map[string]*schema.Schema{
1818
"instance_id": {

cloudamqp/data_source_cloudamqp_plugins.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import (
55
"log"
66

77
"github.com/84codes/go-api/api"
8-
"github.com/hashicorp/terraform-plugin-sdk/helper/schema"
8+
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
99
)
1010

1111
func dataSourcePlugins() *schema.Resource {

cloudamqp/data_source_cloudamqp_plugins_community.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import (
55
"log"
66

77
"github.com/84codes/go-api/api"
8-
"github.com/hashicorp/terraform-plugin-sdk/helper/schema"
8+
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
99
)
1010

1111
func dataSourcePluginsCommunity() *schema.Resource {

cloudamqp/data_source_cloudamqp_upgradable_versions.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import (
44
"strconv"
55

66
"github.com/84codes/go-api/api"
7-
"github.com/hashicorp/terraform-plugin-sdk/helper/schema"
7+
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
88
)
99

1010
func dataSourceUpgradableVersions() *schema.Resource {

0 commit comments

Comments
 (0)