diff --git a/docs/resources/artifact_store.md b/docs/resources/artifact_store.md index c7244fd..d6b847b 100644 --- a/docs/resources/artifact_store.md +++ b/docs/resources/artifact_store.md @@ -25,6 +25,17 @@ resource "gocd_artifact_store" "docker" { } ``` +## Importing the existing GoCD artifact store to Terraform State +```terraform +resource "gocd_artifact_store" "docker" { + store_id = "docker" +} +``` + +```shell +# Once the above code is added, the resource can be imported by running the below command. +terraform import gocd_artifact_store.docker docker +``` ## Schema diff --git a/docs/resources/auth_config.md b/docs/resources/auth_config.md index ca905cb..5958985 100644 --- a/docs/resources/auth_config.md +++ b/docs/resources/auth_config.md @@ -21,6 +21,17 @@ resource "gocd_auth_config" "password_file_config" { } ``` +## Importing the existing GoCD authorization configuration to Terraform State +```terraform +resource "gocd_auth_config" "password_file_config" { + profile_id = "admin_new" +} +``` + +```shell +# Once the above code is added, the resource can be imported by running the below command. +terraform import gocd_auth_config.password_file_config admin_new +``` ## Schema diff --git a/docs/resources/cluster_profile.md b/docs/resources/cluster_profile.md index d7fc627..f73e320 100644 --- a/docs/resources/cluster_profile.md +++ b/docs/resources/cluster_profile.md @@ -25,6 +25,17 @@ resource "gocd_cluster_profile" "kube_cluster_profile" { } ``` +## Importing the existing elastic agent profile to Terraform State +```terraform +resource "gocd_cluster_profile" "sample_cluster_profile" { + profile_id = "sample_ec2" +} +``` + +```shell +# Once the above code is added, the resource can be imported by running the below command. +terraform import gocd_cluster_profile.sample_cluster_profile sample_ec2 +``` ## Schema diff --git a/docs/resources/elastic_agent_profile.md b/docs/resources/elastic_agent_profile.md index e4879b8..a9f3cf4 100644 --- a/docs/resources/elastic_agent_profile.md +++ b/docs/resources/elastic_agent_profile.md @@ -21,6 +21,17 @@ resource "gocd_elastic_agent_profile" "sample_kubernetes" { } ``` +## Importing the existing cluster profile to Terraform State +```terraform +resource "gocd_elastic_agent_profile" "some_cluster_profile" { + profile_id = "kube_cluster_profile" +} +``` + +```shell +# Once the above code is added, the resource can be imported by running the below command. +terraform import gocd_elastic_agent_profile.some_cluster_profile kube_cluster_profile +``` ## Schema diff --git a/docs/resources/environment.md b/docs/resources/environment.md index 9ae79c7..ec426c8 100644 --- a/docs/resources/environment.md +++ b/docs/resources/environment.md @@ -24,6 +24,17 @@ resource "gocd_environment" "sample_environment" { } ``` +## Importing the existing GoCD environments to Terraform State +```terraform +resource "gocd_environment" "sample_environment" { + name = "sample_environment" +} +``` + +```shell +# Once the above code is added, the resource can be imported by running the below command. +terraform import gocd_environment.sample_environment sample_environment +``` ## Schema diff --git a/templates/resources/artifact_store.md.tmpl b/templates/resources/artifact_store.md.tmpl index c7244fd..d6b847b 100644 --- a/templates/resources/artifact_store.md.tmpl +++ b/templates/resources/artifact_store.md.tmpl @@ -25,6 +25,17 @@ resource "gocd_artifact_store" "docker" { } ``` +## Importing the existing GoCD artifact store to Terraform State +```terraform +resource "gocd_artifact_store" "docker" { + store_id = "docker" +} +``` + +```shell +# Once the above code is added, the resource can be imported by running the below command. +terraform import gocd_artifact_store.docker docker +``` ## Schema diff --git a/templates/resources/auth_config.md.tmpl b/templates/resources/auth_config.md.tmpl index ca905cb..5958985 100644 --- a/templates/resources/auth_config.md.tmpl +++ b/templates/resources/auth_config.md.tmpl @@ -21,6 +21,17 @@ resource "gocd_auth_config" "password_file_config" { } ``` +## Importing the existing GoCD authorization configuration to Terraform State +```terraform +resource "gocd_auth_config" "password_file_config" { + profile_id = "admin_new" +} +``` + +```shell +# Once the above code is added, the resource can be imported by running the below command. +terraform import gocd_auth_config.password_file_config admin_new +``` ## Schema diff --git a/templates/resources/cluster_profile.md.tmpl b/templates/resources/cluster_profile.md.tmpl index d7fc627..f73e320 100644 --- a/templates/resources/cluster_profile.md.tmpl +++ b/templates/resources/cluster_profile.md.tmpl @@ -25,6 +25,17 @@ resource "gocd_cluster_profile" "kube_cluster_profile" { } ``` +## Importing the existing elastic agent profile to Terraform State +```terraform +resource "gocd_cluster_profile" "sample_cluster_profile" { + profile_id = "sample_ec2" +} +``` + +```shell +# Once the above code is added, the resource can be imported by running the below command. +terraform import gocd_cluster_profile.sample_cluster_profile sample_ec2 +``` ## Schema diff --git a/templates/resources/elastic_agent_profile.md.tmpl b/templates/resources/elastic_agent_profile.md.tmpl index e4879b8..a9f3cf4 100644 --- a/templates/resources/elastic_agent_profile.md.tmpl +++ b/templates/resources/elastic_agent_profile.md.tmpl @@ -21,6 +21,17 @@ resource "gocd_elastic_agent_profile" "sample_kubernetes" { } ``` +## Importing the existing cluster profile to Terraform State +```terraform +resource "gocd_elastic_agent_profile" "some_cluster_profile" { + profile_id = "kube_cluster_profile" +} +``` + +```shell +# Once the above code is added, the resource can be imported by running the below command. +terraform import gocd_elastic_agent_profile.some_cluster_profile kube_cluster_profile +``` ## Schema diff --git a/templates/resources/environment.md.tmpl b/templates/resources/environment.md.tmpl index 9ae79c7..ec426c8 100644 --- a/templates/resources/environment.md.tmpl +++ b/templates/resources/environment.md.tmpl @@ -24,6 +24,17 @@ resource "gocd_environment" "sample_environment" { } ``` +## Importing the existing GoCD environments to Terraform State +```terraform +resource "gocd_environment" "sample_environment" { + name = "sample_environment" +} +``` + +```shell +# Once the above code is added, the resource can be imported by running the below command. +terraform import gocd_environment.sample_environment sample_environment +``` ## Schema