Documentation ¶
Index ¶
- Constants
- func ApplyDefaults(typedInputs ExtensionResourceInputs) (ExtensionResourceInputs, []ValidationFailure)
- func ApplyDiff(values resource.PropertyMap, diff *resource.ObjectDiff) resource.PropertyMap
- func AutoNamingTypeSpec() pschema.ObjectTypeSpec
- func CalcPatch(oldInputs resource.PropertyMap, newInputs resource.PropertyMap, ...) ([]jsonpatch.JsonPatchOperation, error)
- func CalculateUntypedPatch(typedOldInputs ExtensionResourceInputs, typedInputs ExtensionResourceInputs) ([]jsonpatch.JsonPatchOperation, error)
- func ExtensionResourceSpec() pschema.ResourceSpec
- func NewExtensionResource(client client.CloudControlClient) *extensionResource
- type AutoNaming
- type CustomResource
- type ExtensionResourceInputs
- type ValidationFailure
Constants ¶
View Source
const AutoNamingTypeToken = "aws-native:index:AutoNaming"
Variables ¶
This section is empty.
Functions ¶
func ApplyDefaults ¶
func ApplyDefaults(typedInputs ExtensionResourceInputs) (ExtensionResourceInputs, []ValidationFailure)
func ApplyDiff ¶
func ApplyDiff(values resource.PropertyMap, diff *resource.ObjectDiff) resource.PropertyMap
ApplyDiff produces a new map as a merge of a calculated diff into an existing map of values.
func AutoNamingTypeSpec ¶
func AutoNamingTypeSpec() pschema.ObjectTypeSpec
func CalcPatch ¶
func CalcPatch(oldInputs resource.PropertyMap, newInputs resource.PropertyMap, spec metadata.CloudAPIResource, types map[string]metadata.CloudAPIType) ([]jsonpatch.JsonPatchOperation, error)
func CalculateUntypedPatch ¶
func CalculateUntypedPatch(typedOldInputs ExtensionResourceInputs, typedInputs ExtensionResourceInputs) ([]jsonpatch.JsonPatchOperation, error)
func ExtensionResourceSpec ¶
func ExtensionResourceSpec() pschema.ResourceSpec
func NewExtensionResource ¶
func NewExtensionResource(client client.CloudControlClient) *extensionResource
Types ¶
type AutoNaming ¶
type CustomResource ¶
type CustomResource interface { // Check validates and transforms the inputs of the resource. Check(ctx context.Context, urn resource.URN, randomSeed []byte, inputs, state resource.PropertyMap, defaultTags map[string]string) (resource.PropertyMap, []ValidationFailure, error) // Create creates a new resource in the cloud provider and returns its unique identifier and outputs. Create(ctx context.Context, urn resource.URN, inputs resource.PropertyMap) (identifier *string, outputs map[string]any, err error) // Read returns the outputs and the updated inputs of the resource. Read(ctx context.Context, urn resource.URN, id string, oldInputs, oldOutputs resource.PropertyMap) (outputs map[string]any, inputs resource.PropertyMap, exists bool, err error) // Update applies the diff of the inputs to the resource and returns the updated outputs. Update(ctx context.Context, urn resource.URN, id string, inputs, oldInputs resource.PropertyMap) (map[string]any, error) // Delete removes the resource from the cloud provider. Delete(ctx context.Context, urn resource.URN, id string, inputs resource.PropertyMap) error }
type ExtensionResourceInputs ¶
type ExtensionResourceInputs struct { Type string Properties map[string]any CreateOnly []string WriteOnly []string TagsProperty string TagsStyle default_tags.TagsStyle AutoNaming *AutoNaming }
func (*ExtensionResourceInputs) AddWriteOnlyProps ¶
func (r *ExtensionResourceInputs) AddWriteOnlyProps(resourceState map[string]interface{}) map[string]interface{}
AddWriteOnlyProps fills in the write-only properties from the old state as they won't be returned when reading.
type ValidationFailure ¶
func ValidateResource ¶
func ValidateResource(res *metadata.CloudAPIResource, types map[string]metadata.CloudAPIType, properties resource.PropertyMap) ([]ValidationFailure, error)
Click to show internal directories.
Click to hide internal directories.