Commit d3d639d3 authored by Cyril Plisko's avatar Cyril Plisko

Separate json and yaml examples with shared template

parent 9d7c7543
Pipeline #81881507 failed with stage
in 4 minutes
......@@ -8,6 +8,7 @@ repository = "https://gitlab.com/imp/cumulus-rs.git"
license = "Apache-2.0 OR MIT"
keywords = ["aws", "cloudformation"]
readme = "README.md"
autoexamples = false
[badges]
gitlab = { repository = "imp/cumulus-rs" }
......@@ -22,3 +23,10 @@ serde_yaml = { version = "0.8.9", optional = true }
[features]
pedantic = []
yaml = ["serde_yaml"]
[[example]]
name = "json"
[[example]]
name = "yaml"
required-features = ["yaml"]
mod template;
fn main() {
let template = template::template().json_pretty();
println!("{}", template);
}
use cumulus::ec2::{EIp, Instance};
use cumulus::Template;
fn main() {
pub fn template() -> Template {
let proxy1 = Instance::new().instance_type("t2.micro");
let proxy2 = proxy1.clone();
let eip1 = EIp::vpc();
let eip2 = EIp::vpc();
let template = Template::new()
let mut template = Template::new();
template
.description("Proxy Farm")
.resource("proxy1", proxy1)
.resource("proxy1-ip", eip1)
.resource("proxy2", proxy2)
.resource("proxy2-ip", eip2)
.json_pretty();
.resource("proxy2-ip", eip2);
println!("{}", template);
template
}
mod template;
fn main() {
let template = template::template().yaml();
println!("{}", template);
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment