-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
New Resource & Data Source: azurerm_data_migration_service #5258
Conversation
This PR depends on #5259 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR @magodo, iv'e left some comments inline that need to be addressed before we merge this
azurerm/internal/services/datamigration/data_source_data_migration_service.go
Outdated
Show resolved
Hide resolved
azurerm/internal/services/datamigration/data_source_data_migration_service.go
Outdated
Show resolved
Hide resolved
azurerm/internal/services/datamigration/data_source_data_migration_service.go
Outdated
Show resolved
Hide resolved
azurerm/internal/services/datamigration/data_source_data_migration_service.go
Outdated
Show resolved
Hide resolved
azurerm/internal/services/datamigration/data_source_data_migration_service.go
Outdated
Show resolved
Hide resolved
azurerm/internal/services/datamigration/resource_arm_data_migration_service.go
Outdated
Show resolved
Hide resolved
azurerm/internal/services/datamigration/tests/resource_arm_data_migration_service_test.go
Outdated
Show resolved
Hide resolved
azurerm/internal/services/datamigration/tests/resource_arm_data_migration_service_test.go
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR @magodo, iv'e left some comments inline that need to be addressed before we merge this
Mostly include: - order schema - add validation func for `name`, `sku_name` - unexport `provisioning_state` - unexport `delete_running_task` - add nil check for `sku` - add dedicated update acctest - modify naming in acctest config - modify document for r/d
b575f77
to
de27be1
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the revisions @magodo, i've left some more comments inline
azurerm/internal/services/datamigration/data_source_data_migration_service.go
Outdated
Show resolved
Hide resolved
azurerm/internal/services/datamigration/resource_arm_data_migration_service.go
Outdated
Show resolved
Hide resolved
azurerm/internal/services/datamigration/data_source_data_migration_service.go
Outdated
Show resolved
Hide resolved
azurerm/internal/services/datamigration/resource_arm_data_migration_service.go
Outdated
Show resolved
Hide resolved
azurerm/internal/services/datamigration/resource_arm_data_migration_service.go
Outdated
Show resolved
Hide resolved
azurerm/internal/services/datamigration/data_source_data_migration_service.go
Outdated
Show resolved
Hide resolved
azurerm/internal/services/datamigration/resource_arm_data_migration_service.go
Outdated
Show resolved
Hide resolved
azurerm/internal/services/datamigration/tests/resource_arm_data_migration_service_test.go
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hey @magodo
Thanks for this PR :)
Taking a look through this is looking good to me - if we can remove the data source, fix up the pending comments (and the tests pass) then this should otherwise be good 👍
Thanks!
azurerm/internal/services/datamigration/resource_arm_data_migration_service.go
Outdated
Show resolved
Hide resolved
azurerm/internal/services/datamigration/resource_arm_data_migration_service.go
Outdated
Show resolved
Hide resolved
azurerm/internal/services/datamigration/data_source_data_migration_service.go
Outdated
Show resolved
Hide resolved
azurerm/internal/services/datamigration/tests/resource_arm_data_migration_service_test.go
Outdated
Show resolved
Hide resolved
azurerm/internal/services/datamigration/tests/resource_arm_data_migration_service_test.go
Outdated
Show resolved
Hide resolved
azurerm/internal/services/datamigration/resource_arm_data_migration_service.go
Outdated
Show resolved
Hide resolved
Changes include: - remove `kind` property from resource - `resource_group_name` schema case sensitive - acctest always ended with a import test step - document changes TBD: - Whether need to remove data source? - Shall we show this resource on website sidebar?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the updates @magodo, in addition to my comments it looks like you have a test failure:
Test Failed
------- Stdout: -------
=== RUN TestAccAzureRMDataMigrationService_complete
panic: Invalid address to set: []string{"id"}
goroutine 328 [running]:
github.com/hashicorp/terraform-plugin-sdk/helper/schema.(*ResourceData).Set(0xc000a317a0, 0x4061c0c, 0x2, 0x39b0140, 0xc0013a0ea0, 0x0, 0xdf8475800)
/opt/teamcity-agent/work/dbea4b84960ec72a/pkg/mod/github.com/hashicorp/[email protected]/helper/schema/resource_data.go:193 +0x354
github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/services/datamigration.resourceArmDataMigrationServiceRead(0xc000a317a0, 0x3aa3100, 0xc001122240, 0x0, 0x0)
/opt/teamcity-agent/work/dbea4b84960ec72a/src/github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/services/datamigration/resource_arm_data_migration_service.go:158 +0x5ba
github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/services/datamigration.resourceArmDataMigrationServiceCreate(0xc000a317a0, 0x3aa3100, 0xc001122240, 0x0, 0x0)
/opt/teamcity-agent/work/dbea4b84960ec72a/src/github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/services/datamigration/resource_arm_data_migration_service.go:133 +0xa38
github.com/hashicorp/terraform-plugin-sdk/helper/schema.(*Resource).Apply(0xc000bfb980, 0xc000796050, 0xc00162c2a0, 0x3aa3100, 0xc001122240, 0xc001630301, 0xc001984150, 0xc0016303d0)
/opt/teamcity-agent/work/dbea4b84960ec72a/pkg/mod/github.com/hashicorp/[email protected]/helper/schema/resource.go:305 +0x365
github.com/hashicorp/terraform-plugin-sdk/helper/schema.(*Provider).Apply(0xc00148e400, 0xc001039918, 0xc000796050, 0xc00162c2a0, 0xc0016303e0, 0xc0008b9160, 0x3a7eae0)
/opt/teamcity-agent/work/dbea4b84960ec72a/pkg/mod/github.com/hashicorp/[email protected]/helper/schema/provider.go:294 +0x99
github.com/hashicorp/terraform-plugin-sdk/internal/helper/plugin.(*GRPCProviderServer).ApplyResourceChange(0xc0008b84b8, 0x47dcf00, 0xc001942cc0, 0xc0015e3680, 0xc0008b84b8, 0xc001942cc0, 0xc00255da80)
/opt/teamcity-agent/work/dbea4b84960ec72a/pkg/mod/github.com/hashicorp/[email protected]/internal/helper/plugin/grpc_provider.go:885 +0x882
github.com/hashicorp/terraform-plugin-sdk/internal/tfplugin5._Provider_ApplyResourceChange_Handler(0x3e50c60, 0xc0008b84b8, 0x47dcf00, 0xc001942cc0, 0xc0015e3620, 0x0, 0x47dcf00, 0xc001942cc0, 0xc001629180, 0x370)
/opt/teamcity-agent/work/dbea4b84960ec72a/pkg/mod/github.com/hashicorp/[email protected]/internal/tfplugin5/tfplugin5.pb.go:3189 +0x217
google.golang.org/grpc.(*Server).processUnaryRPC(0xc002be5080, 0x482eee0, 0xc001252000, 0xc0015f9100, 0xc0013fc0c0, 0x71d1ae0, 0x0, 0x0, 0x0)
/opt/teamcity-agent/work/dbea4b84960ec72a/pkg/mod/google.golang.org/[email protected]/server.go:995 +0x460
google.golang.org/grpc.(*Server).handleStream(0xc002be5080, 0x482eee0, 0xc001252000, 0xc0015f9100, 0x0)
/opt/teamcity-agent/work/dbea4b84960ec72a/pkg/mod/google.golang.org/[email protected]/server.go:1275 +0xd97
google.golang.org/grpc.(*Server).serveStreams.func1.1(0xc001097ea0, 0xc002be5080, 0x482eee0, 0xc001252000, 0xc0015f9100)
/opt/teamcity-agent/work/dbea4b84960ec72a/pkg/mod/google.golang.org/[email protected]/server.go:710 +0xbb
created by google.golang.org/grpc.(*Server).serveStreams.func1
/opt/teamcity-agent/work/dbea4b84960ec72a/pkg/mod/google.golang.org/[email protected]/server.go:708 +0xa1
FAIL github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/services/datamigration/tests 942.276s
azurerm/internal/services/datamigration/data_source_data_migration_service.go
Outdated
Show resolved
Hide resolved
azurerm/internal/services/datamigration/data_source_data_migration_service.go
Outdated
Show resolved
Hide resolved
azurerm/internal/services/datamigration/resource_arm_data_migration_service.go
Outdated
Show resolved
Hide resolved
azurerm/internal/services/datamigration/resource_arm_data_migration_service.go
Outdated
Show resolved
Hide resolved
azurerm/internal/services/datamigration/resource_arm_data_migration_service.go
Outdated
Show resolved
Hide resolved
Hi Kat, I rerun the test locally after apply your review comment, it works as expected. Not sure the cause of the error attached above. |
@magodo, we run tests with |
@katbyte, I run the acc test via makefile of the project. I think it had already export |
azurerm/internal/services/datamigration/resource_arm_data_migration_service.go
Outdated
Show resolved
Hide resolved
Tests are passing for us now 🎉 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the changes @magodo, LGTM 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@magodo, looks like CI errors needs to be fixed up, but once they are thus should be gtg
@katbyte |
1. rename resource to "database_migration_service" to comply to the naming of azure official document. 2. introduce custom id parse function.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the revisions @magodo,
I've left some more (mostly) minor comments inline that one addressed this should be good to merge!
azurerm/internal/services/databasemigration/data_source_database_migration_service.go
Outdated
Show resolved
Hide resolved
azurerm/internal/services/databasemigration/data_source_database_migration_service.go
Show resolved
Hide resolved
azurerm/internal/services/databasemigration/resource_arm_database_migration_service.go
Outdated
Show resolved
Hide resolved
azurerm/internal/services/databasemigration/resource_arm_database_migration_service.go
Show resolved
Hide resolved
azurerm/internal/services/databasemigration/resource_arm_database_migration_service.go
Show resolved
Hide resolved
...rm/internal/services/databasemigration/tests/resource_arm_database_migration_service_test.go
Show resolved
Hide resolved
...rm/internal/services/databasemigration/tests/resource_arm_database_migration_service_test.go
Show resolved
Hide resolved
...rm/internal/services/databasemigration/tests/resource_arm_database_migration_service_test.go
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for those changes @magodo. LGTM now 👍
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. If you feel I made an error 🤖 🙉 , please reach out to my human friends 👉 [email protected]. Thanks! |
Add new resource: data migration service.
This is the first resource under DataMigration resource provider.
There are more resources to come (which are not included in this PR):
I will implement those two resources after this PR is merged since they depends on data migration service.
Check feature request #5257 for more details.