This PR introduces a new importer for the All jamf pro resource in our Terraform provider. The importer uses the schema.ImportStatePassthroughContext to facilitate the straightforward import of existing Any instances into Terraform management without any transformations.
Implementation Details
Importer Configuration: The importer is configured to directly pass through the state information from the provider. This is done by setting StateContext to schema.ImportStatePassthroughContext in the schema.ResourceImporter struct. This method ensures that the state read from the underlying API is directly mapped to Terraform's state management without any modifications.
Resource Affected: All
Purpose
The addition of this importer enables users to easily integrate their existing <ResourceName> resources with Terraform, making it possible to manage these resources through Terraform without needing to recreate them. This is particularly useful for users who are transitioning to Terraform management and have pre-existing infrastructure that needs to be incorporated without disruption.
Usage
Users can import their existing <ResourceName> resources by executing the following command:
This command will read the current state of the resource from the underlying service and bring it under Terraform management.
Testing
Unit Tests: Added unit tests to validate the importer logic and ensure that the state is correctly passed through from the provider.
Integration Tests: Conducted integration tests to ensure the functionality works as expected with real-world scenarios.
Documentation
Updated Documentation: Documentation has been updated to reflect the new importing capabilities, providing users with guidance on how to import existing <ResourceName> resources.
Notes
This change does not impact other resources or any existing functionality within the provider. It solely adds importing capabilities to <ResourceName>.
Summary
This PR introduces a new importer for the
All jamf pro
resource in our Terraform provider. The importer uses theschema.ImportStatePassthroughContext
to facilitate the straightforward import of existingAny
instances into Terraform management without any transformations.Implementation Details
Importer Configuration: The importer is configured to directly pass through the state information from the provider. This is done by setting
StateContext
toschema.ImportStatePassthroughContext
in theschema.ResourceImporter
struct. This method ensures that the state read from the underlying API is directly mapped to Terraform's state management without any modifications.Resource Affected:
All
Purpose
The addition of this importer enables users to easily integrate their existing
<ResourceName>
resources with Terraform, making it possible to manage these resources through Terraform without needing to recreate them. This is particularly useful for users who are transitioning to Terraform management and have pre-existing infrastructure that needs to be incorporated without disruption.Usage
Users can import their existing
<ResourceName>
resources by executing the following command:This command will read the current state of the resource from the underlying service and bring it under Terraform management.
Testing
Documentation
<ResourceName>
resources.Notes
This change does not impact other resources or any existing functionality within the provider. It solely adds importing capabilities to
<ResourceName>
.