Documentation ¶
Overview ¶
Package stack contains the serialized and configurable state associated with an stack; or, in other words, a deployment target. It pertains to resources and deployment plans, but is a package unto itself.
Index ¶
- Constants
- Variables
- func DeserializeCheckpoint(chkpoint *apitype.CheckpointV2) (*deploy.Snapshot, error)
- func DeserializeDeploymentV2(deployment apitype.DeploymentV2) (*deploy.Snapshot, error)
- func DeserializeOperation(op apitype.OperationV1) (resource.Operation, error)
- func DeserializeProperties(props map[string]interface{}) (resource.PropertyMap, error)
- func DeserializePropertyValue(v interface{}) (resource.PropertyValue, error)
- func DeserializeResource(res apitype.ResourceV2) (*resource.State, error)
- func DeserializeUntypedDeployment(deployment *apitype.UntypedDeployment) (*deploy.Snapshot, error)
- func GetRootStackResource(snap *deploy.Snapshot) (*resource.State, map[string]interface{})
- func SerializeCheckpoint(stack tokens.QName, config config.Map, snap *deploy.Snapshot) *apitype.VersionedCheckpoint
- func SerializeDeployment(snap *deploy.Snapshot) *apitype.DeploymentV2
- func SerializeOperation(op resource.Operation) apitype.OperationV1
- func SerializeProperties(props resource.PropertyMap) map[string]interface{}
- func SerializePropertyValue(prop resource.PropertyValue) interface{}
- func SerializeResource(res *resource.State) apitype.ResourceV2
- func UnmarshalVersionedCheckpointToLatestCheckpoint(bytes []byte) (*apitype.CheckpointV2, error)
Constants ¶
const ( // DeploymentSchemaVersionOldestSupported is the oldest deployment schema that we // still support, i.e. we can produce a `deploy.Snapshot` from. This will generally // need to be at least one less than the current schema version so that old deployments can // be migrated to the current schema. DeploymentSchemaVersionOldestSupported = 1 )
Variables ¶
var ( // ErrDeploymentSchemaVersionTooOld is returned from `DeserializeDeployment` if the // untyped deployment being deserialized is too old to understand. ErrDeploymentSchemaVersionTooOld = fmt.Errorf("this stack's deployment is too old") // ErrDeploymentSchemaVersionTooNew is returned from `DeserializeDeployment` if the // untyped deployment being deserialized is too new to understand. ErrDeploymentSchemaVersionTooNew = fmt.Errorf("this stack's deployment version is too new") )
Functions ¶
func DeserializeCheckpoint ¶
func DeserializeCheckpoint(chkpoint *apitype.CheckpointV2) (*deploy.Snapshot, error)
DeserializeCheckpoint takes a serialized deployment record and returns its associated snapshot. Returns nil if there have been no deployments performed on this checkpoint.
func DeserializeDeploymentV2 ¶ added in v0.15.0
func DeserializeDeploymentV2(deployment apitype.DeploymentV2) (*deploy.Snapshot, error)
DeserializeDeploymentV2 deserializes a typed DeploymentV2 into a `deploy.Snapshot`.
func DeserializeOperation ¶ added in v0.15.0
func DeserializeOperation(op apitype.OperationV1) (resource.Operation, error)
func DeserializeProperties ¶
func DeserializeProperties(props map[string]interface{}) (resource.PropertyMap, error)
DeserializeProperties deserializes an entire map of deploy properties into a resource property map.
func DeserializePropertyValue ¶
func DeserializePropertyValue(v interface{}) (resource.PropertyValue, error)
DeserializePropertyValue deserializes a single deploy property into a resource property value.
func DeserializeResource ¶
func DeserializeResource(res apitype.ResourceV2) (*resource.State, error)
DeserializeResource turns a serialized resource back into its usual form.
func DeserializeUntypedDeployment ¶ added in v0.15.0
func DeserializeUntypedDeployment(deployment *apitype.UntypedDeployment) (*deploy.Snapshot, error)
DeserializeUntypedDeployment deserializes an untyped deployment and produces a `deploy.Snapshot` from it. DeserializeDeployment will return an error if the untyped deployment's version is not within the range `DeploymentSchemaVersionCurrent` and `DeploymentSchemaVersionOldestSupported`.
func GetRootStackResource ¶
GetRootStackResource returns the root stack resource from a given snapshot, or nil if not found. If the stack exists, its output properties, if any, are also returned in the resulting map.
func SerializeCheckpoint ¶
func SerializeCheckpoint(stack tokens.QName, config config.Map, snap *deploy.Snapshot) *apitype.VersionedCheckpoint
SerializeCheckpoint turns a snapshot into a data structure suitable for serialization.
func SerializeDeployment ¶
func SerializeDeployment(snap *deploy.Snapshot) *apitype.DeploymentV2
SerializeDeployment serializes an entire snapshot as a deploy record.
func SerializeOperation ¶ added in v0.15.0
func SerializeOperation(op resource.Operation) apitype.OperationV1
func SerializeProperties ¶
func SerializeProperties(props resource.PropertyMap) map[string]interface{}
SerializeProperties serializes a resource property bag so that it's suitable for serialization.
func SerializePropertyValue ¶
func SerializePropertyValue(prop resource.PropertyValue) interface{}
SerializePropertyValue serializes a resource property value so that it's suitable for serialization.
func SerializeResource ¶
func SerializeResource(res *resource.State) apitype.ResourceV2
SerializeResource turns a resource into a structure suitable for serialization.
func UnmarshalVersionedCheckpointToLatestCheckpoint ¶
func UnmarshalVersionedCheckpointToLatestCheckpoint(bytes []byte) (*apitype.CheckpointV2, error)
Types ¶
This section is empty.