From: Xiangxuan Liu Date: Tue, 18 Jun 2019 03:21:00 +0000 (+0800) Subject: Add importer X-Git-Tag: v0.1.1~16^2 X-Git-Url: https://git.immae.eu/?a=commitdiff_plain;h=cfbd89c06cc2bfc2e4defc067dc3a8841404a95d;p=github%2Ffretlink%2Fterraform-provider-statuscake.git Add importer --- diff --git a/statuscake/resource_statuscaketest.go b/statuscake/resource_statuscaketest.go index b062456..d8604e6 100644 --- a/statuscake/resource_statuscaketest.go +++ b/statuscake/resource_statuscaketest.go @@ -34,6 +34,9 @@ func resourceStatusCakeTest() *schema.Resource { Update: UpdateTest, Delete: DeleteTest, Read: ReadTest, + Importer: &schema.ResourceImporter{ + State: schema.ImportStatePassthrough, + }, Schema: map[string]*schema.Schema{ "test_id": { diff --git a/website/docs/r/test.html.markdown b/website/docs/r/test.html.markdown index 6c65f10..0f99fb4 100644 --- a/website/docs/r/test.html.markdown +++ b/website/docs/r/test.html.markdown @@ -63,3 +63,11 @@ The following arguments are supported: The following attribute is exported: * `test_id` - A unique identifier for the test. + +## Import + +StatusCake test can be imported using the test id, e.g. + +``` +tf import statuscake_test.example 123 +``` \ No newline at end of file