software.amazon.awscdk.ICfnConditionExpression Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of cdk Show documentation
Show all versions of cdk Show documentation
AWS Cloud Development Kit Core Library
package software.amazon.awscdk;
/**
* Represents a CloudFormation element that can be used within a Condition.
*
* You can use intrinsic functions, such as ``Fn.conditionIf``,
* ``Fn.conditionEquals``, and ``Fn.conditionNot``, to conditionally create
* stack resources. These conditions are evaluated based on input parameters
* that you declare when you create or update a stack. After you define all your
* conditions, you can associate them with resources or resource properties in
* the Resources and Outputs sections of a template.
*
* You define all conditions in the Conditions section of a template except for
* ``Fn.conditionIf`` conditions. You can use the ``Fn.conditionIf`` condition
* in the metadata attribute, update policy attribute, and property values in
* the Resources section and Outputs sections of a template.
*
* You might use conditions when you want to reuse a template that can create
* resources in different contexts, such as a test environment versus a
* production environment. In your template, you can add an EnvironmentType
* input parameter, which accepts either prod or test as inputs. For the
* production environment, you might include Amazon EC2 instances with certain
* capabilities; however, for the test environment, you want to use less
* capabilities to save costs. With conditions, you can define which resources
* are created and how they're configured for each environment type.
*/
@javax.annotation.Generated(value = "jsii-pacmak/0.10.5 (build 46bc9b0)", date = "2019-05-06T20:49:40.951Z")
public interface ICfnConditionExpression extends software.amazon.jsii.JsiiSerializable {
/**
* Returns a JSON node that represents this condition expression.
*/
java.lang.Object resolve(final software.amazon.awscdk.ResolveContext context);
/**
* Returns a string token representation of this condition expression, which resolves to the CloudFormation condition JSON during synthesis.
*
* You can use `toString` when you wish to embed a condition expression
* in a property value that accepts a `string`. For example:
*
* ```ts
* * new sqs.Queue(this, 'MyQueue', {
* * queueName: Fn.conditionIf('Condition', 'Hello', 'World').toString()
* * });
* * ```
*
* NOTE: we need this explicitly here despite the fact that in JavaScript this would
* "just work" since conditions are eventually tokens that implement `toString`,
* in order for jsii languages like Java to proxy this to jsii.
*/
java.lang.String toString();
/**
* A proxy class which represents a concrete javascript instance of this type.
*/
final static class Jsii$Proxy extends software.amazon.jsii.JsiiObject implements software.amazon.awscdk.ICfnConditionExpression {
protected Jsii$Proxy(final software.amazon.jsii.JsiiObject.InitializationMode mode) {
super(mode);
}
/**
* Returns a JSON node that represents this condition expression.
*/
@Override
@javax.annotation.Nullable
public java.lang.Object resolve(final software.amazon.awscdk.ResolveContext context) {
return this.jsiiCall("resolve", java.lang.Object.class, new Object[] { java.util.Objects.requireNonNull(context, "context is required") });
}
/**
* Returns a string token representation of this condition expression, which resolves to the CloudFormation condition JSON during synthesis.
*
* You can use `toString` when you wish to embed a condition expression
* in a property value that accepts a `string`. For example:
*
* ```ts
* * new sqs.Queue(this, 'MyQueue', {
* * queueName: Fn.conditionIf('Condition', 'Hello', 'World').toString()
* * });
* * ```
*
* NOTE: we need this explicitly here despite the fact that in JavaScript this would
* "just work" since conditions are eventually tokens that implement `toString`,
* in order for jsii languages like Java to proxy this to jsii.
*/
@Override
public java.lang.String toString() {
return this.jsiiCall("toString", java.lang.String.class);
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy