Documentation
¶
Overview ¶
Package activation_code implements the jamfplatform_pro_activation_code singleton resource and data source backed by the Jamf ProClassic /activationcode endpoint.
Index ¶
- func NewActivationCodeDataSource() datasource.DataSource
- func NewActivationCodeResource() resource.Resource
- type ActivationCodeDataSource
- func (d *ActivationCodeDataSource) Configure(ctx context.Context, req datasource.ConfigureRequest, ...)
- func (d *ActivationCodeDataSource) Metadata(ctx context.Context, req datasource.MetadataRequest, ...)
- func (d *ActivationCodeDataSource) Read(ctx context.Context, req datasource.ReadRequest, resp *datasource.ReadResponse)
- func (d *ActivationCodeDataSource) Schema(ctx context.Context, req datasource.SchemaRequest, ...)
- type ActivationCodeDataSourceModel
- type ActivationCodeResource
- func (r *ActivationCodeResource) Configure(ctx context.Context, req resource.ConfigureRequest, ...)
- func (r *ActivationCodeResource) Create(ctx context.Context, req resource.CreateRequest, resp *resource.CreateResponse)
- func (r *ActivationCodeResource) Delete(ctx context.Context, _ resource.DeleteRequest, _ *resource.DeleteResponse)
- func (r *ActivationCodeResource) IdentitySchema(ctx context.Context, req resource.IdentitySchemaRequest, ...)
- func (r *ActivationCodeResource) ImportState(ctx context.Context, req resource.ImportStateRequest, ...)
- func (r *ActivationCodeResource) Metadata(ctx context.Context, req resource.MetadataRequest, ...)
- func (r *ActivationCodeResource) Read(ctx context.Context, req resource.ReadRequest, resp *resource.ReadResponse)
- func (r *ActivationCodeResource) Schema(ctx context.Context, req resource.SchemaRequest, resp *resource.SchemaResponse)
- func (r *ActivationCodeResource) Update(ctx context.Context, req resource.UpdateRequest, resp *resource.UpdateResponse)
- type ActivationCodeResourceModel
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewActivationCodeDataSource ¶
func NewActivationCodeDataSource() datasource.DataSource
NewActivationCodeDataSource returns a new instance of ActivationCodeDataSource.
func NewActivationCodeResource ¶
NewActivationCodeResource returns a new instance of ActivationCodeResource.
Types ¶
type ActivationCodeDataSource ¶
type ActivationCodeDataSource struct {
// contains filtered or unexported fields
}
ActivationCodeDataSource implements the Terraform data source for the Jamf Pro activation code.
func (*ActivationCodeDataSource) Configure ¶
func (d *ActivationCodeDataSource) Configure(ctx context.Context, req datasource.ConfigureRequest, resp *datasource.ConfigureResponse)
Configure wires the Jamf ProClassic client into the data source.
func (*ActivationCodeDataSource) Metadata ¶
func (d *ActivationCodeDataSource) Metadata(ctx context.Context, req datasource.MetadataRequest, resp *datasource.MetadataResponse)
Metadata sets the data source type name for the Terraform provider.
func (*ActivationCodeDataSource) Read ¶
func (d *ActivationCodeDataSource) Read(ctx context.Context, req datasource.ReadRequest, resp *datasource.ReadResponse)
Read fetches the current activation code and populates Terraform state.
func (*ActivationCodeDataSource) Schema ¶
func (d *ActivationCodeDataSource) Schema(ctx context.Context, req datasource.SchemaRequest, resp *datasource.SchemaResponse)
Schema returns the data source schema.
type ActivationCodeDataSourceModel ¶
type ActivationCodeDataSourceModel struct {
ID types.String `tfsdk:"id"`
OrganizationName types.String `tfsdk:"organization_name"`
Code types.String `tfsdk:"code"`
Timeouts datasourceTimeouts.Value `tfsdk:"timeouts"`
}
ActivationCodeDataSourceModel represents the Terraform data source model.
type ActivationCodeResource ¶
type ActivationCodeResource struct {
// contains filtered or unexported fields
}
ActivationCodeResource implements the singleton resource for the Jamf Pro activation code. Backed by an Update-only ProClassic API (GET + PUT; no Create/Delete on the remote): Create funnels into Update; Delete is a no-op that only removes the object from Terraform state. The activation code is a license secret — never delete or blank it, and never PUT a partial body (a partial write risks wiping the license).
func (*ActivationCodeResource) Configure ¶
func (r *ActivationCodeResource) Configure(ctx context.Context, req resource.ConfigureRequest, resp *resource.ConfigureResponse)
Configure wires the Jamf ProClassic client into the resource via the shared providerdata.ConfigureProClassic helper.
func (*ActivationCodeResource) Create ¶
func (r *ActivationCodeResource) Create(ctx context.Context, req resource.CreateRequest, resp *resource.CreateResponse)
Create handles initial provisioning of the activation code singleton. The ProClassic API has no Create endpoint for this object, so this funnels into Update against the plan, then reads back to capture authoritative state.
func (*ActivationCodeResource) Delete ¶
func (r *ActivationCodeResource) Delete(ctx context.Context, _ resource.DeleteRequest, _ *resource.DeleteResponse)
Delete is a no-op on the ProClassic API. The activation code is a license secret that must persist on the tenant — there is no remote delete, and blanking it would disable the tenant. Terraform removes the resource from state on its own after this returns.
func (*ActivationCodeResource) IdentitySchema ¶
func (r *ActivationCodeResource) IdentitySchema(ctx context.Context, req resource.IdentitySchemaRequest, resp *resource.IdentitySchemaResponse)
IdentitySchema defines the identifier used for import. Singleton resources accept only the fixed helpers.SingletonID value.
func (*ActivationCodeResource) ImportState ¶
func (r *ActivationCodeResource) ImportState(ctx context.Context, req resource.ImportStateRequest, resp *resource.ImportStateResponse)
ImportState handles import for the singleton. Only the fixed helpers.SingletonID value is accepted; any other identifier is rejected with a clear error.
terraform import jamfplatform_pro_activation_code.<name> singleton
func (*ActivationCodeResource) Metadata ¶
func (r *ActivationCodeResource) Metadata(ctx context.Context, req resource.MetadataRequest, resp *resource.MetadataResponse)
Metadata sets the resource type name for the Terraform provider.
func (*ActivationCodeResource) Read ¶
func (r *ActivationCodeResource) Read(ctx context.Context, req resource.ReadRequest, resp *resource.ReadResponse)
Read refreshes Terraform state with the latest activation code from the ProClassic API.
func (*ActivationCodeResource) Schema ¶
func (r *ActivationCodeResource) Schema(ctx context.Context, req resource.SchemaRequest, resp *resource.SchemaResponse)
Schema returns the Terraform schema for the activation code resource.
func (*ActivationCodeResource) Update ¶
func (r *ActivationCodeResource) Update(ctx context.Context, req resource.UpdateRequest, resp *resource.UpdateResponse)
Update writes the new activation code and organization name to the ProClassic API. Both fields are always written together (see buildActivationCodeInput).
type ActivationCodeResourceModel ¶
type ActivationCodeResourceModel struct {
ID types.String `tfsdk:"id"`
OrganizationName types.String `tfsdk:"organization_name"`
Code types.String `tfsdk:"code"`
Timeouts resourceTimeouts.Value `tfsdk:"timeouts"`
}
ActivationCodeResourceModel represents the Terraform resource model for the Jamf Pro activation code singleton. Both fields round-trip through a single ProClassic GET/PUT — the GET returns the code in clear, so normal drift detection applies.