Documentation
¶
Overview ¶
Main entry point to construct the intune settings catalog profile resource for the Terraform provider.
Index ¶
- Constants
- func MapRemoteResourceStateToTerraform(ctx context.Context, data *sharedmodels.ReuseablePolicySettingsResourceModel, ...)
- func NewReuseablePolicySettingsResource() resource.Resource
- type ReuseablePolicySettingsResource
- func (r *ReuseablePolicySettingsResource) Configure(ctx context.Context, req resource.ConfigureRequest, ...)
- func (r *ReuseablePolicySettingsResource) Create(ctx context.Context, req resource.CreateRequest, resp *resource.CreateResponse)
- func (r *ReuseablePolicySettingsResource) Delete(ctx context.Context, req resource.DeleteRequest, resp *resource.DeleteResponse)
- func (r *ReuseablePolicySettingsResource) FullTypeName() string
- func (r *ReuseablePolicySettingsResource) ImportState(ctx context.Context, req resource.ImportStateRequest, ...)
- func (r *ReuseablePolicySettingsResource) Metadata(ctx context.Context, req resource.MetadataRequest, ...)
- func (r *ReuseablePolicySettingsResource) ModifyPlan(ctx context.Context, req resource.ModifyPlanRequest, ...)
- func (r *ReuseablePolicySettingsResource) Read(ctx context.Context, req resource.ReadRequest, resp *resource.ReadResponse)
- func (r *ReuseablePolicySettingsResource) Schema(ctx context.Context, req resource.SchemaRequest, resp *resource.SchemaResponse)
- func (r *ReuseablePolicySettingsResource) Update(ctx context.Context, req resource.UpdateRequest, resp *resource.UpdateResponse)
Constants ¶
const ( ResourceName = "graph_beta_device_management_reuseable_policy_setting" CreateTimeout = 180 UpdateTimeout = 180 ReadTimeout = 180 DeleteTimeout = 180 )
Variables ¶
This section is empty.
Functions ¶
func MapRemoteResourceStateToTerraform ¶
func MapRemoteResourceStateToTerraform(ctx context.Context, data *sharedmodels.ReuseablePolicySettingsResourceModel, remoteResource graphmodels.DeviceManagementReusablePolicySettingable)
MapRemoteResourceStateToTerraform states the base properties of a EndpointPrivilegeManagementResourceModel to a Terraform state
Types ¶
type ReuseablePolicySettingsResource ¶
type ReuseablePolicySettingsResource struct { ProviderTypeName string TypeName string ReadPermissions []string WritePermissions []string ResourcePath string // contains filtered or unexported fields }
func (*ReuseablePolicySettingsResource) Configure ¶
func (r *ReuseablePolicySettingsResource) Configure(ctx context.Context, req resource.ConfigureRequest, resp *resource.ConfigureResponse)
Configure sets the client for the resource.
func (*ReuseablePolicySettingsResource) Create ¶
func (r *ReuseablePolicySettingsResource) Create(ctx context.Context, req resource.CreateRequest, resp *resource.CreateResponse)
Create handles the Create operation for Settings Catalog resources.
- Retrieves the planned configuration from the create request
- Constructs the resource request body from the plan
- Sends POST request to create the base resource and settings
- Captures the new resource ID from the response
- Constructs and sends assignment configuration if specified
- Sets initial state with planned values
- Calls Read operation to fetch the latest state from the API
- Updates the final state with the fresh data from the API
The function ensures that both the settings catalog profile and its assignments (if specified) are created properly. The settings must be defined during creation as they are required for a successful deployment, while assignments are optional.
func (*ReuseablePolicySettingsResource) Delete ¶
func (r *ReuseablePolicySettingsResource) Delete(ctx context.Context, req resource.DeleteRequest, resp *resource.DeleteResponse)
Delete handles the Delete operation for Settings Catalog resources.
- Retrieves the current state from the delete request
- Validates the state data and timeout configuration
- Sends DELETE request to remove the resource from the API
- Cleans up by removing the resource from Terraform state
The function ensures that the resource is completely removed from the Microsoft Graph API and cleans up the Terraform state accordingly.
func (*ReuseablePolicySettingsResource) FullTypeName ¶
func (r *ReuseablePolicySettingsResource) FullTypeName() string
FullTypeName returns the full type name of the resource for logging purposes.
func (*ReuseablePolicySettingsResource) ImportState ¶
func (r *ReuseablePolicySettingsResource) ImportState(ctx context.Context, req resource.ImportStateRequest, resp *resource.ImportStateResponse)
ImportState imports the resource state.
func (*ReuseablePolicySettingsResource) Metadata ¶
func (r *ReuseablePolicySettingsResource) Metadata(ctx context.Context, req resource.MetadataRequest, resp *resource.MetadataResponse)
Metadata returns the resource type name.
func (*ReuseablePolicySettingsResource) ModifyPlan ¶
func (r *ReuseablePolicySettingsResource) ModifyPlan(ctx context.Context, req resource.ModifyPlanRequest, resp *resource.ModifyPlanResponse)
ModifyPlan handles plan modification for diff suppression
func (*ReuseablePolicySettingsResource) Read ¶
func (r *ReuseablePolicySettingsResource) Read(ctx context.Context, req resource.ReadRequest, resp *resource.ReadResponse)
Read handles the Read operation for Settings Catalog resources.
- Retrieves the current state from the read request
- Gets the base resource details from the API
- Maps the base resource details to Terraform state
- Gets the settings configuration from the API
- Maps the settings configuration to Terraform state
- Gets the assignments configuration from the API
- Maps the assignments configuration to Terraform state
The function ensures that all components (base resource, settings, and assignments) are properly read and mapped into the Terraform state, providing a complete view of the resource's current configuration on the server.
func (*ReuseablePolicySettingsResource) Schema ¶
func (r *ReuseablePolicySettingsResource) Schema(ctx context.Context, req resource.SchemaRequest, resp *resource.SchemaResponse)
Function to create the full device management win32 lob app schema
func (*ReuseablePolicySettingsResource) Update ¶
func (r *ReuseablePolicySettingsResource) Update(ctx context.Context, req resource.UpdateRequest, resp *resource.UpdateResponse)
Update handles the Update operation for Settings Catalog resources.
- Retrieves the planned changes from the update request
- Constructs the resource request body from the plan
- Sends PUT request to update the base resource and settings
- Constructs the assignment request body from the plan
- Sends POST request to update the assignments
- Sets initial state with planned values
- Calls Read operation to fetch the latest state from the API
- Updates the final state with the fresh data from the API
The function ensures that both the settings and assignments are updated atomically, and the final state reflects the actual state of the resource on the server.