Sha256: cd3382778922a095128827c05e96a77678d34d45d63253cd8ff8a3af4fd8f252

Contents?: true

Size: 1.53 KB

Versions: 16

Compression:

Stored size: 1.53 KB

Contents

---
title: "Translation"
category: "dsl"
weight: 9
anchors:
  - title: "Supported Translations"
    url: "#supported-translations"
  - title: "Usage"
    url: "#usage"
---

## Translation

SparkleFormation has alpha support for template translation from
AWS CFN to target orchestration API template formats.

> NOTE: Translations do not currently support stack nesting functionality

### Supported Translations

Basic support implementations:

* OpenStack
* Rackspace

### Usage

Translations are based around AWS CFN and then target some
remote orchestration API (currently Heat and Rackspace). First
the template must be compiled, then it is passed to the translator
which converts the CFN specific template to the expected format
of the target API:

~~~ruby
sfn = SparkleFormation.new(:my_stack) do
  ...
end

cfn_template = sfn.compile.dump!
translator = SparkleFormation::Translation::Heat.new(cfn_template)

heat_template = translator.translate!
~~~

In general applications of translators, the implementation will
first collect optional template parameters prior to translation
allowing the translator access to parameters that may be required
in places where the resultant template may not have support for
dynamic references. These can then be passed to the translator:

~~~ruby
sfn = SparkleFormation.new(:my_stack) do
  ...
end

cfn_template = sfn.compile.dump!
custom_params = collect_parameters(cfn_template)
translator = SparkleFormation::Translation::Heat.new(
  cfn_template,
  :parameters => custom_params
)

heat_template = translator.translate!
~~~

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
sparkle_formation-2.1.8 docs/translation.md
sparkle_formation-2.1.6 docs/translation.md
sparkle_formation-2.1.4 docs/translation.md
sparkle_formation-2.1.2 docs/translation.md
sparkle_formation-2.1.0 docs/translation.md
sparkle_formation-2.0.2 docs/translation.md
sparkle_formation-2.0.0 docs/translation.md
sparkle_formation-1.2.0 docs/translation.md
sparkle_formation-1.1.14 docs/translation.md
sparkle_formation-1.1.12 docs/translation.md
sparkle_formation-1.1.10 docs/translation.md
sparkle_formation-1.1.8 docs/translation.md
sparkle_formation-1.1.6 docs/translation.md
sparkle_formation-1.1.4 docs/translation.md
sparkle_formation-1.1.2 docs/translation.md
sparkle_formation-1.1.0 docs/translation.md