Class CfnCondition
Represents a CloudFormation condition, for resources which must be conditionally created and the determination must be made at deploy time.
public class CfnCondition : CfnElement, IConstruct, IConstruct, IDependable, ICfnConditionExpression, IResolvable
- Inheritance
-
CfnCondition
- Implements
-
IConstruct
- Inherited Members
Examples
var rawBucket = new CfnBucket(this, "Bucket", new CfnBucketProps { });
// -or-
var rawBucketAlt = (CfnBucket)myBucket.Node.DefaultChild;
// then
rawBucket.CfnOptions.Condition = new CfnCondition(this, "EnableBucket", new CfnConditionProps { });
rawBucket.CfnOptions.Metadata = new Dictionary<string, object> {
{ "metadataKey", "MetadataValue" }
};
Remarks
ExampleMetadata: infused
Constructors
CfnCondition(Construct, string, ICfnConditionProps?)
Build a new condition.
public CfnCondition(Construct scope, string id, ICfnConditionProps? props = null)
Parameters
scope
Constructid
stringprops
ICfnConditionProps
Remarks
The condition must be constructed with a condition token, that the condition is based on.
Properties
Expression
The condition statement.
public virtual ICfnConditionExpression? Expression { get; set; }
Property Value
Methods
Resolve(IResolveContext)
Synthesizes the condition.
public virtual object Resolve(IResolveContext context)
Parameters
context
IResolveContext