Documentation
¶
Index ¶
- func CCDataSource(config CCDataSourceConfig, ...) provider.DataSource
- func CCResource(config CCResourceConfig, ...) provider.Resource
- func CFNToSpec(node *core.MappingNode, schema *provider.ResourceDefinitionsSchema, ...) *core.MappingNode
- func FlattenForDataSource(node *core.MappingNode, schema *provider.ResourceDefinitionsSchema) map[string]*core.MappingNode
- func IsCCPropagationFailure(statusMessage string) bool
- func MatchesFilters(filters *provider.ResolvedDataSourceFilters, ...) bool
- func SpecToCFN(node *core.MappingNode, schema *provider.ResourceDefinitionsSchema, ...) *core.MappingNode
- type CCDataSourceConfig
- type CCResourceConfig
- type CCResourceMeta
- type TagShape
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CCDataSource ¶
func CCDataSource( config CCDataSourceConfig, cloudControlServiceFactory pluginutils.ServiceFactory[*aws.Config, cloudcontrolservice.Service], awsConfigStore pluginutils.ServiceConfigStore[*aws.Config], ) provider.DataSource
CCDataSource builds a provider.DataSource backed by the generic Cloud Control engine. The fetch reads the resource via GetResource (fast path for an exact identifier/ARN filter) or ListResources + client-side filtering, then translates the CFN properties into typed, flattened exports.
func CCResource ¶
func CCResource( config CCResourceConfig, cloudControlServiceFactory pluginutils.ServiceFactory[*aws.Config, cloudcontrolservice.Service], resourceGroupTaggingServiceFactory pluginutils.ServiceFactory[*aws.Config, resgrouptagservice.Service], awsConfigStore pluginutils.ServiceConfigStore[*aws.Config], ) provider.Resource
CCResource builds a provider.Resource backed by the generic Cloud Control engine, with all CRUD funcs parameterised by the resource type's CFN name and metadata.
func CFNToSpec ¶
func CFNToSpec( node *core.MappingNode, schema *provider.ResourceDefinitionsSchema, meta CCResourceMeta, ) *core.MappingNode
CFNToSpec translates a CloudFormation property node into the typed spec shape, translating the CloudFormation property names to the provider's resource field names.
func FlattenForDataSource ¶
func FlattenForDataSource( node *core.MappingNode, schema *provider.ResourceDefinitionsSchema, ) map[string]*core.MappingNode
FlattenForDataSource flattens a typed spec node into the data source export shape, guided by the schema (the export contract is flat, scalars + arrays-of-primitives):
- nested objects -> dot-notation scalar keys (e.g. "provisionedThroughput.readCapacityUnits")
- arrays (of scalars or objects) -> kept whole under a single key
- maps -> serialised to a JSON string (the export contract has no map/object type)
- scalars -> mapped directly
It is schema-aware so a map (dynamic keys) is not mistaken for an object and dot-flattened by its data; the codegen derives export fields by the same rules.
func IsCCPropagationFailure ¶ added in v0.5.0
IsCCPropagationFailure reports whether a failed Cloud Control operation failed for a reason that clears on its own, so the deployment can be retried rather than abandoned.
func MatchesFilters ¶
func MatchesFilters( filters *provider.ResolvedDataSourceFilters, fields map[string]*core.MappingNode, ) bool
MatchesFilters reports whether a resource (its flattened export fields) satisfies every resolved filter. Cloud Control offers no server-side filtering, so the engine lists resources and evaluates the framework's filter operators here. All filters are combined with logical AND.
func SpecToCFN ¶
func SpecToCFN( node *core.MappingNode, schema *provider.ResourceDefinitionsSchema, meta CCResourceMeta, ) *core.MappingNode
SpecToCFN translates a typed spec node into the CloudFormation property shape, translating the resource field names to the CloudFormation property names.
Types ¶
type CCDataSourceConfig ¶
type CCDataSourceConfig struct {
// BlueprintType is the Bluelink data source type, e.g. "aws/dynamodb/table".
BlueprintType string
// CFNType is the CloudFormation type name, e.g. "AWS::DynamoDB::Table".
CFNType string
Label string
// PlainTextSummary and FormattedDescription document the data source type.
PlainTextSummary string
FormattedDescription string
// Schema is the typed resource schema, reused to translate the
// fetched Cloud Control properties into typed exports.
// (overlays can make alterations to the schema)
Schema *provider.ResourceDefinitionsSchema
// Meta carries the per-type information the engine needs for identifier resolution
// and CFN<->spec name translation.
Meta CCResourceMeta
// FilterFields declares the filterable fields exposed to practitioners.
FilterFields map[string]*provider.DataSourceFilterSchema
// ExportFields declares the (flattened) exportable fields.
ExportFields map[string]*provider.DataSourceSpecSchema
// DeriveIdentifierFromARN enables a fast path where a single `arn` equality filter
// is resolved to the primary identifier by taking the ARN's final segment. Set for
// name-style identifiers (e.g. eventBus name, table name); leave false where the
// identifier is the ARN itself or a non-derivable form (e.g. an SQS queue URL).
DeriveIdentifierFromARN bool
// FormattedExamples holds rendered example markdown for the data source type.
FormattedExamples []string
}
CCDataSourceConfig is the per-type configuration for a Cloud Control–backed data source. Codegen emits one of these per included CloudFormation type.
type CCResourceConfig ¶
type CCResourceConfig struct {
// BlueprintType is the Bluelink resource type, e.g. "aws/sqs/queue".
BlueprintType string
// CFNType is the CloudFormation type name, e.g. "AWS::SQS::Queue".
CFNType string
Label string
PlainTextSummary string
FormattedDescription string
// Schema is the generated resource spec schema (the engine augments it with
// internal Cloud Control bookkeeping fields).
Schema *provider.ResourceDefinitionsSchema
// Meta carries per-type information the generic engine cannot infer at runtime.
Meta CCResourceMeta
// FormattedExamples holds rendered example markdown for the resource type.
FormattedExamples []string
// CommonTerminal hints whether the resource is not expected to link out.
CommonTerminal bool
}
CCResourceConfig is the per-type configuration for a Cloud Control–backed resource. Codegen emits one of these per included CloudFormation type.
type CCResourceMeta ¶
type CCResourceMeta struct {
// PrimaryIdentifierField is the user-facing spec field that mirrors the CFN
// primaryIdentifier which is also used as the resource definition's IDField.
// For composite identifiers it holds the first component.
PrimaryIdentifierField string
// PrimaryIdentifierFields holds all components of a composite CFN
// primaryIdentifier, in order. When set (length > 1), the engine joins the
// component spec values with "|" to form Cloud Control's composite identifier
// if no stored identifier is available. Empty for single-identifier types.
PrimaryIdentifierFields []string
// ComputedFields lists spec field paths (without the "spec." prefix) that map
// to CFN readOnlyProperties. They are stripped from desired state and update patches.
ComputedFields []string
// CreateOnlyFields lists spec field paths mapping to CFN createOnlyProperties.
// Changes to these route through MustRecreate, never an update patch.
CreateOnlyFields []string
// WriteOnlyFields lists spec field paths mapping to CFN writeOnlyProperties.
// Cloud Control never returns these, so they are excluded from update diffs
// and external state reconciliation.
WriteOnlyFields []string
// TagPropertyName is the spec/CFN property holding tags, or "" when untaggable.
TagPropertyName string
// TagShape describes how TagPropertyName encodes tags.
TagShape TagShape
// FieldNameOverrides maps a camelCase field path (with "*" for array/map
// descent) to its CloudFormation property name. This is for fields where a simple
// first-character flip does not round-trip, such as
// "sseSpecification" <-> "SSESpecification".
// Absent paths fall back to flipping the first character of the last path segment.
FieldNameOverrides map[string]string
// JSONStringFields lists camelCase field paths (with "*" for array/map descent)
// that hold a CloudFormation free-form object encoded as a JSON string. The
// engine parses the string into a JSON object when building Cloud Control
// desired state and serialises the object back to a string when reading
// external state.
JSONStringFields []string
}
CCResourceMeta carries the per-type information the generic engine cannot infer from a resource spec at runtime. It is supplied by codegen from the CloudFormation resource type schema.
func (CCResourceMeta) IsTaggable ¶
func (m CCResourceMeta) IsTaggable() bool
IsTaggable reports whether the resource type exposes a tag property.
Source Files
¶
- cc_converters.go
- cc_data_source.go
- cc_data_source_fetch.go
- cc_data_source_filter.go
- cc_data_source_flatten.go
- cc_deploy.go
- cc_meta.go
- cc_names.go
- cc_resource.go
- cc_resource_create.go
- cc_resource_destroy.go
- cc_resource_get_external_state.go
- cc_resource_stabilised.go
- cc_resource_update.go
- cc_retry.go
- cc_spec.go
- cc_tags.go