resources

package
v0.10.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 10, 2025 License: MIT Imports: 27 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConvertStringPtrMapToTerraform added in v0.9.2

func ConvertStringPtrMapToTerraform(p map[string]*string) basetypes.MapValue

TODO replcae with the implemetnation in core

func CreateDriftMessage added in v0.10.0

func CreateDriftMessage(tkn string) string

func IsDriftMessage added in v0.10.0

func IsDriftMessage(v string) bool

func WrappedAzKeyVaultObjectConfidentialMaterialModelSchema

func WrappedAzKeyVaultObjectConfidentialMaterialModelSchema(oreAttrs map[string]resourceSchema.Attribute) map[string]resourceSchema.Attribute

func WrappedConfidentialMaterialModelDatasourceSchema

func WrappedConfidentialMaterialModelDatasourceSchema(moreAttrs map[string]datasourceSchema.Attribute) map[string]datasourceSchema.Attribute

func WrappedConfidentialMaterialModelSchema

func WrappedConfidentialMaterialModelSchema(moreAttrs map[string]resourceSchema.Attribute, requireReplace bool) map[string]resourceSchema.Attribute

Types

type APIObjectToStateImporter added in v0.10.0

type APIObjectToStateImporter[TMdl, AZAPIObject any] func(azObj AZAPIObject, tfModel *TMdl)

APIObjectToStateImporter an API object into the state

type AttributeTyped added in v0.10.0

type AttributeTyped interface {
	GetAttributeTypes() map[string]attr.Type
	GetMarkdownDescription() string
}

type CommonConfidentialResource

type CommonConfidentialResource struct {
	Factory core.AZClientsFactory
}

CommonConfidentialResource common methods for all confidential resources

func (*CommonConfidentialResource) CheckCiphertextCreateExpiry added in v0.10.0

func (d *CommonConfidentialResource) CheckCiphertextCreateExpiry(ctx context.Context, header core.ConfidentialDataJsonHeader, dg *diag.Diagnostics)

func (*CommonConfidentialResource) CheckCiphertextExpiry added in v0.10.0

func (d *CommonConfidentialResource) CheckCiphertextExpiry(ctx context.Context, header core.ConfidentialDataJsonHeader, dg *diag.Diagnostics)

type CommonConfidentialResourceSpecialization added in v0.10.0

type CommonConfidentialResourceSpecialization[TMdl any, TConfData any, AZAPIObject any] interface {
	SetFactory(factory core.AZClientsFactory)
	NewTerraformModel() TMdl
	ConvertToTerraform(ctx context.Context, azObj AZAPIObject, tfModel *TMdl) diag.Diagnostics
	GetConfidentialMaterialFrom(mdl TMdl) ConfidentialMaterialModel
	Decrypt(ctx context.Context, em core.EncryptedMessage, decr core.RSADecrypter) (core.ConfidentialDataJsonHeader, TConfData, error)
	CheckPlacement(ctx context.Context, providerConstraints []core.ProviderConstraint, placementConstraints []core.PlacementConstraint, tfModel *TMdl) diag.Diagnostics

	DoCreate(ctx context.Context, planData *TMdl, plainData TConfData) (AZAPIObject, diag.Diagnostics)
	DoDelete(ctx context.Context, planData *TMdl) diag.Diagnostics
}

type ConfidentialDatasourceBase

type ConfidentialDatasourceBase struct {
	CommonConfidentialResource
}

func (*ConfidentialDatasourceBase) Configure

type ConfidentialGenericResource added in v0.10.0

type ConfidentialGenericResource[TMdl, TIdentity any, TConfData any, AZAPIObject any] struct {
	ConfidentialResourceBase
	Specializer CommonConfidentialResourceSpecialization[TMdl, TConfData, AZAPIObject]
	ImmutableRU ImmutableConfidentialResourceRU[TMdl, TConfData, AZAPIObject]
	MutableRU   MutableConfidentialResourceRU[TMdl, TConfData, AZAPIObject]

	ResourceName   string
	ResourceSchema schema.Schema
}

func (*ConfidentialGenericResource[TMdl, TIdentity, TConfData, AZAPIObject]) Configure added in v0.10.0

func (d *ConfidentialGenericResource[TMdl, TIdentity, TConfData, AZAPIObject]) Configure(ctx context.Context, req resource.ConfigureRequest, resp *resource.ConfigureResponse)

func (*ConfidentialGenericResource[TMdl, TIdentity, TConfData, AZAPIObject]) Create added in v0.10.0

func (d *ConfidentialGenericResource[TMdl, TIdentity, TConfData, AZAPIObject]) Create(ctx context.Context, req resource.CreateRequest, resp *resource.CreateResponse)

func (*ConfidentialGenericResource[TMdl, TIdentity, TConfData, AZAPIObject]) CreateT added in v0.10.0

func (d *ConfidentialGenericResource[TMdl, TIdentity, TConfData, AZAPIObject]) CreateT(ctx context.Context, req RequestAbstraction, resp ResponseAbstraction)

func (*ConfidentialGenericResource[TMdl, TIdentity, TConfData, AZAPIObject]) Delete added in v0.10.0

func (d *ConfidentialGenericResource[TMdl, TIdentity, TConfData, AZAPIObject]) Delete(ctx context.Context, req resource.DeleteRequest, resp *resource.DeleteResponse)

func (*ConfidentialGenericResource[TMdl, TIdentity, TConfData, AZAPIObject]) Metadata added in v0.10.0

func (d *ConfidentialGenericResource[TMdl, TIdentity, TConfData, AZAPIObject]) Metadata(_ context.Context, req resource.MetadataRequest, resp *resource.MetadataResponse)

func (*ConfidentialGenericResource[TMdl, TIdentity, TConfData, AZAPIObject]) Read added in v0.10.0

func (d *ConfidentialGenericResource[TMdl, TIdentity, TConfData, AZAPIObject]) Read(ctx context.Context, req resource.ReadRequest, resp *resource.ReadResponse)

func (*ConfidentialGenericResource[TMdl, TIdentity, TConfData, AZAPIObject]) ReadT added in v0.10.0

func (d *ConfidentialGenericResource[TMdl, TIdentity, TConfData, AZAPIObject]) ReadT(ctx context.Context, req RequestAbstraction, resp ResponseAbstraction)

func (*ConfidentialGenericResource[TMdl, TIdentity, TConfData, AZAPIObject]) Schema added in v0.10.0

func (d *ConfidentialGenericResource[TMdl, TIdentity, TConfData, AZAPIObject]) Schema(_ context.Context, _ resource.SchemaRequest, resp *resource.SchemaResponse)

func (*ConfidentialGenericResource[TMdl, TIdentity, TConfData, AZAPIObject]) Update added in v0.10.0

func (d *ConfidentialGenericResource[TMdl, TIdentity, TConfData, AZAPIObject]) Update(ctx context.Context, req resource.UpdateRequest, resp *resource.UpdateResponse)

type ConfidentialMaterialLocator added in v0.10.0

type ConfidentialMaterialLocator[TMdl any] func(mdl TMdl) ConfidentialMaterialModel

type ConfidentialMaterialModel

type ConfidentialMaterialModel struct {
	Id types.String `tfsdk:"id"`

	WrappingKeyCoordinate *core.WrappingKeyCoordinateModel `tfsdk:"wrapping_key"`

	EncryptedSecret types.String `tfsdk:"content"`
}

func (*ConfidentialMaterialModel) GetDestinationCoordinateFromId

func (wcmm *ConfidentialMaterialModel) GetDestinationCoordinateFromId() (core.AzKeyVaultObjectVersionedCoordinate, error)

TODO: This method must be attached elsewhere in the inheritence hierarcy; as it is meansingful only with the Az Key Vault objects.

func (*ConfidentialMaterialModel) SetContainsValues added in v0.10.0

func (wcmmm *ConfidentialMaterialModel) SetContainsValues(s *types.Set) bool

type ConfidentialResourceBase

type ConfidentialResourceBase struct {
	CommonConfidentialResource
}

func (*ConfidentialResourceBase) Configure

type Exportable added in v0.10.0

type Exportable interface {
	Into(ctx context.Context, c *core.SecondaryProtectionParameters) error
}

type FunctionTemplate added in v0.10.0

type FunctionTemplate[TMdl any, TProtection ProtectionParameterized, DestMdl any] struct {
	Name                                    string
	Summary                                 string
	MarkdownDescription                     string
	DataParameter                           function.Parameter
	ProtectionParameterSupplier             core.Supplier[TProtection]
	DestinationParameter                    function.Parameter
	DestinationParameterMarkdownDescription string
	ConfidentialModelSupplier               core.Supplier[TMdl]
	DestinationModelSupplier                core.Supplier[*DestMdl]
	CreatEncryptedMessage                   func(confidentialModel TMdl, dest *DestMdl, md core.SecondaryProtectionParameters, pubKey *rsa.PublicKey) (core.EncryptedMessage, error)
}

func (*FunctionTemplate[TMdl, TProtection, DestMdl]) Definition added in v0.10.0

func (f *FunctionTemplate[TMdl, TProtection, DestMdl]) Definition(_ context.Context, _ function.DefinitionRequest, resp *function.DefinitionResponse)

func (*FunctionTemplate[TMdl, TProtection, DestMdl]) Metadata added in v0.10.0

func (f *FunctionTemplate[TMdl, TProtection, DestMdl]) Metadata(_ context.Context, _ function.MetadataRequest, resp *function.MetadataResponse)

func (*FunctionTemplate[TMdl, TProtection, DestMdl]) Run added in v0.10.0

func (f *FunctionTemplate[TMdl, TProtection, DestMdl]) Run(ctx context.Context, req function.RunRequest, resp *function.RunResponse)

type IdAssigner added in v0.10.0

type IdAssigner[TMdl, AZAPIObject any] func(azObj AZAPIObject, tfModel *TMdl)

type ImmutableConfidentialResourceRU added in v0.10.0

type ImmutableConfidentialResourceRU[TMdl any, TConfData any, AZAPIObject any] interface {
	DoRead(ctx context.Context, planData *TMdl) (AZAPIObject, ResourceExistenceCheck, diag.Diagnostics)
	DoUpdate(ctx context.Context, planData *TMdl) (AZAPIObject, diag.Diagnostics)
}

type LimitedCreateProtectionParam added in v0.10.0

type LimitedCreateProtectionParam struct {
	CreateLimit types.String `tfsdk:"create_limit"`
}

func (LimitedCreateProtectionParam) GetAttributeTypes added in v0.10.0

func (p LimitedCreateProtectionParam) GetAttributeTypes() map[string]attr.Type

func (LimitedCreateProtectionParam) Into added in v0.10.0

type MutableConfidentialResourceRU added in v0.10.0

type MutableConfidentialResourceRU[TMdl any, TConfData any, AZAPIObject any] interface {
	DoRead(ctx context.Context, planData *TMdl, lainData TConfData) (AZAPIObject, ResourceExistenceCheck, diag.Diagnostics)
	DoUpdate(ctx context.Context, planData *TMdl, lainData TConfData) (AZAPIObject, diag.Diagnostics)
	// SetDriftToConfidentialData changes the confidential data on the plan to trigger the
	// update.
	SetDriftToConfidentialData(ctx context.Context, planData *TMdl)
}

type ProtectionParameterized added in v0.10.0

type ProtectionParameterized interface {
	AttributeTyped
	Exportable
}

type ProtectionParams added in v0.10.0

type ProtectionParams struct {
	ExpiresAfterDays    types.Int32 `tfsdk:"expires_after"`
	NumUses             types.Int32 `tfsdk:"num_uses"`
	ProviderConstraints types.Set   `tfsdk:"provider_constraints"`
}

func (ProtectionParams) GetAttributeTypes added in v0.10.0

func (p ProtectionParams) GetAttributeTypes() map[string]attr.Type

func (ProtectionParams) GetMarkdownDescription added in v0.10.0

func (p ProtectionParams) GetMarkdownDescription() string

func (ProtectionParams) Into added in v0.10.0

type PublicKeyValidator added in v0.10.0

type PublicKeyValidator struct{}

func (*PublicKeyValidator) ValidateParameterString added in v0.10.0

type RequestAbstraction added in v0.10.0

type RequestAbstraction struct {
	Get      func(ctx context.Context, val interface{}) diag.Diagnostics
	HasError func() bool
}

type ResourceExistenceCheck added in v0.10.0

type ResourceExistenceCheck int
const (
	ResourceCheckNotAttempted ResourceExistenceCheck = iota
	ResourceExists
	ResourceNotFound
	ResourceNotYetCreated
	ResourceCheckError
	ResourceConfidentialDataDrift
)

func (ResourceExistenceCheck) String added in v0.10.0

func (t ResourceExistenceCheck) String() string

type ResourceProtectionParams added in v0.10.0

type ResourceProtectionParams struct {
	ProtectionParams
	LimitedCreateProtectionParam
}

func (ResourceProtectionParams) GetAttributeTypes added in v0.10.0

func (p ResourceProtectionParams) GetAttributeTypes() map[string]attr.Type

func (ResourceProtectionParams) GetMarkdownDescription added in v0.10.0

func (p ResourceProtectionParams) GetMarkdownDescription() string

func (ResourceProtectionParams) Into added in v0.10.0

type ResponseAbstraction added in v0.10.0

type ResponseAbstraction struct {
	Set            func(ctx context.Context, val interface{}) diag.Diagnostics
	RemoveResource func(context.Context)
	Diagnostics    *diag.Diagnostics
}

type WrappedAzKeyVaultObjectConfidentialMaterialModel

type WrappedAzKeyVaultObjectConfidentialMaterialModel struct {
	ConfidentialMaterialModel

	Tags      types.Map    `tfsdk:"tags"`
	NotBefore types.String `tfsdk:"not_before_date"`
	NotAfter  types.String `tfsdk:"not_after_date"`
	Enabled   types.Bool   `tfsdk:"enabled"`
}

WrappedAzKeyVaultObjectConfidentialMaterialModel a model for the Azure KeyVault object. It includes wrapped confidential data and repeated elements (not-before, not-after, tags, and enabled)

func (*WrappedAzKeyVaultObjectConfidentialMaterialModel) ConvertAzBool

func (*WrappedAzKeyVaultObjectConfidentialMaterialModel) ConvertAzMap

TODO replace with the implementation in core

func (*WrappedAzKeyVaultObjectConfidentialMaterialModel) ConvertAzString

func (*WrappedAzKeyVaultObjectConfidentialMaterialModel) NotAfterDateAtPtr

func (*WrappedAzKeyVaultObjectConfidentialMaterialModel) NotBeforeDateAtPtr

func (*WrappedAzKeyVaultObjectConfidentialMaterialModel) StringTypeAsPtr

func (*WrappedAzKeyVaultObjectConfidentialMaterialModel) TagsAsPtr

func (*WrappedAzKeyVaultObjectConfidentialMaterialModel) TagsAsStr

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL