pub enum ExpString {
Show 17 variants
Base64(Box<ExpString>),
FindInMap {
map_name: MapName,
top_level_key: Box<ExpString>,
second_level_key: String,
},
GetAtt {
logical_resource_name: LogicalResourceName,
attribute_name: AttributeName,
},
If {
condition_name: ConditionName,
true_branch: Box<ExpString>,
else_branch: Box<ExpString>,
},
ImportValue(OutputExportName),
Join {
delimiter: String,
values: Vec<ExpString>,
},
Literal(String),
Ref(LogicalResourceName),
Select {
index: u8,
values: Box<ExpStringList>,
},
Split {
delimiter: String,
source: Box<ExpString>,
},
Sub {
pattern: String,
},
AwsAccountId,
AwsPartition,
AwsRegion,
AwsStackId,
AwsStackName,
AwsUrlSuffix,
}Variants§
Base64(Box<ExpString>)
FindInMap
GetAtt
If
ImportValue(OutputExportName)
Join
Literal(String)
Ref(LogicalResourceName)
Select
Split
Sub
AwsAccountId
AwsPartition
AwsRegion
AwsStackId
AwsStackName
AwsUrlSuffix
Implementations§
Trait Implementations§
Source§impl FnFindInMap for ExpString
impl FnFindInMap for ExpString
Source§impl From<&LogicalResourceName> for ExpString
impl From<&LogicalResourceName> for ExpString
Source§fn from(value: &LogicalResourceName) -> Self
fn from(value: &LogicalResourceName) -> Self
Converts to this type from the input type.
Source§impl From<&ParameterKey> for ExpString
impl From<&ParameterKey> for ExpString
Source§fn from(value: &ParameterKey) -> Self
fn from(value: &ParameterKey) -> Self
Converts to this type from the input type.
Source§impl From<LogicalResourceName> for ExpString
impl From<LogicalResourceName> for ExpString
Source§fn from(value: LogicalResourceName) -> Self
fn from(value: LogicalResourceName) -> Self
Converts to this type from the input type.
Source§impl From<ParameterKey> for ExpString
impl From<ParameterKey> for ExpString
Source§fn from(value: ParameterKey) -> Self
fn from(value: ParameterKey) -> Self
Converts to this type from the input type.
Source§impl ToValue for ExpString
impl ToValue for ExpString
Source§fn to_value(&self) -> Value
fn to_value(&self) -> Value
Render expression to CF template value^
§Panics
On internal errors/bugs, there is no public API that allows to construct values that panic on this call.
§Examples
assert_eq!(
json!({"Fn::Base64":"some-literal"}),
ExpString::from("some-literal").base64().to_value()
)assert_eq!(
json!({"Fn::If":["condition-name",{"Ref":"resource-a"},{"Ref":"resource-b"}]}),
ExpString::If{
condition_name: "condition-name".into(),
true_branch: Box::new(LogicalResourceName::from("resource-a").into()),
else_branch: Box::new(LogicalResourceName::from("resource-b").into()),
}.to_value()
)
let logical_resource_name = LogicalResourceName::from("some-logical-resource-name");
let reference : ExpString = logical_resource_name.into();
assert_eq!(
json!({"Ref":"some-logical-resource-name"}),
reference.to_value()
)assert_eq!(
json!({"Fn::GetAtt":["some-logical-resource-name", "some-attribute-name"]}),
ExpString::GetAtt{
logical_resource_name: "some-logical-resource-name".into(),
attribute_name: "some-attribute-name".into()
}.to_value()
)String Literal
let exp : ExpString = "some-literal".into();
assert_eq!(json!{"some-literal"}, exp.to_value())assert_eq!(
json!({"Fn::Join":[',', [{"Ref": "some-logical-resource-name"}, "some-literal"]]}),
ExpString::Join{
delimiter: String::from(","),
values: vec![
LogicalResourceName::from("some-logical-resource-name").into(),
"some-literal".into()
]
}.to_value()
)impl Eq for ExpString
impl StructuralPartialEq for ExpString
Auto Trait Implementations§
impl Freeze for ExpString
impl RefUnwindSafe for ExpString
impl Send for ExpString
impl Sync for ExpString
impl Unpin for ExpString
impl UnwindSafe for ExpString
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.