diff --git a/docs/resources/role.md b/docs/resources/role.md index c15843f0..e84df7ac 100644 --- a/docs/resources/role.md +++ b/docs/resources/role.md @@ -32,6 +32,22 @@ resource "spectrocloud_role" "custom_role" { } ``` +``` +### Importing existing role state & config + +```hcl +# import existing user example + import { + to = spectrocloud_role.test_role + id = "{roleUID}" + } + +# To generate TF configuration. + terraform plan -generate-config-out=test_role.tf + +# To import State file + terraform import spectrocloud_role.test_role {roleUID} +``` ## Schema diff --git a/templates/resources/role.md.tmpl b/templates/resources/role.md.tmpl index 60fcf3d7..ffd3e236 100644 --- a/templates/resources/role.md.tmpl +++ b/templates/resources/role.md.tmpl @@ -32,5 +32,21 @@ resource "spectrocloud_role" "custom_role" { } ``` +``` +### Importing existing role state & config + +```hcl +# import existing user example + import { + to = spectrocloud_role.test_role + id = "{roleUID}" + } + +# To generate TF configuration. + terraform plan -generate-config-out=test_role.tf + +# To import State file + terraform import spectrocloud_role.test_role {roleUID} +``` {{ .SchemaMarkdown | trimspace }} \ No newline at end of file