All Downloads are FREE. Search and download functionalities are using the official Maven repository.

software.amazon.awscdk.Fn Maven / Gradle / Ivy

There is a newer version: 0.36.1
Show newest version
package software.amazon.awscdk;

/**
 * CloudFormation intrinsic functions. http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/intrinsic-function-reference.html.
 */
@javax.annotation.Generated(value = "jsii-pacmak/0.10.5 (build 46bc9b0)", date = "2019-05-06T20:49:40.946Z")
@software.amazon.jsii.Jsii(module = software.amazon.awscdk.$Module.class, fqn = "@aws-cdk/cdk.Fn")
public class Fn extends software.amazon.jsii.JsiiObject {
    protected Fn(final software.amazon.jsii.JsiiObject.InitializationMode mode) {
        super(mode);
    }
    public Fn() {
        super(software.amazon.jsii.JsiiObject.InitializationMode.Jsii);
        software.amazon.jsii.JsiiEngine.getInstance().createNewObject(this);
    }

    /**
     * The intrinsic function ``Fn::Base64`` returns the Base64 representation of the input string.
     * 
     * This function is typically used to pass encoded data to
     * Amazon EC2 instances by way of the UserData property.
     * 
     * @return a token represented as a string
     * @param data The string value you want to convert to Base64.
     */
    public static java.lang.String base64(final java.lang.String data) {
        return software.amazon.jsii.JsiiObject.jsiiStaticCall(software.amazon.awscdk.Fn.class, "base64", java.lang.String.class, new Object[] { java.util.Objects.requireNonNull(data, "data is required") });
    }

    /**
     * The intrinsic function ``Fn::Cidr`` returns the specified Cidr address block.
     * 
     * @return a token represented as a string
     * @param ipBlock The user-specified default Cidr address block.
     * @param count The number of subnets' Cidr block wanted.
     * @param sizeMask The digit covered in the subnet.
     */
    public static java.lang.String cidr(final java.lang.String ipBlock, final java.lang.Number count, @javax.annotation.Nullable final java.lang.String sizeMask) {
        return software.amazon.jsii.JsiiObject.jsiiStaticCall(software.amazon.awscdk.Fn.class, "cidr", java.lang.String.class, new Object[] { java.util.Objects.requireNonNull(ipBlock, "ipBlock is required"), java.util.Objects.requireNonNull(count, "count is required"), sizeMask });
    }

    /**
     * The intrinsic function ``Fn::Cidr`` returns the specified Cidr address block.
     * 
     * @return a token represented as a string
     * @param ipBlock The user-specified default Cidr address block.
     * @param count The number of subnets' Cidr block wanted.
     */
    public static java.lang.String cidr(final java.lang.String ipBlock, final java.lang.Number count) {
        return software.amazon.jsii.JsiiObject.jsiiStaticCall(software.amazon.awscdk.Fn.class, "cidr", java.lang.String.class, new Object[] { java.util.Objects.requireNonNull(ipBlock, "ipBlock is required"), java.util.Objects.requireNonNull(count, "count is required") });
    }

    /**
     * Returns true if all the specified conditions evaluate to true, or returns false if any one of the conditions evaluates to false.
     * 
     * ``Fn::And`` acts as
     * an AND operator. The minimum number of conditions that you can include is
     * 2, and the maximum is 10.
     * 
     * @return an FnCondition token
     * @param conditions conditions to AND.
     */
    public static software.amazon.awscdk.ICfnConditionExpression conditionAnd(final software.amazon.awscdk.ICfnConditionExpression... conditions) {
        return software.amazon.jsii.JsiiObject.jsiiStaticCall(software.amazon.awscdk.Fn.class, "conditionAnd", software.amazon.awscdk.ICfnConditionExpression.class, java.util.Arrays.stream(conditions).toArray(Object[]::new));
    }

    /**
     * Returns true if a specified string matches at least one value in a list of strings.
     * 
     * @return an FnCondition token
     * @param listOfStrings A list of strings, such as "A", "B", "C".
     * @param value A string, such as "A", that you want to compare against a list of strings.
     */
    public static software.amazon.awscdk.ICfnConditionExpression conditionContains(final java.util.List listOfStrings, final java.lang.String value) {
        return software.amazon.jsii.JsiiObject.jsiiStaticCall(software.amazon.awscdk.Fn.class, "conditionContains", software.amazon.awscdk.ICfnConditionExpression.class, new Object[] { java.util.Objects.requireNonNull(listOfStrings, "listOfStrings is required"), java.util.Objects.requireNonNull(value, "value is required") });
    }

    /**
     * Compares if two values are equal.
     * 
     * Returns true if the two values are equal
     * or false if they aren't.
     * 
     * @return an FnCondition token
     * @param lhs A value of any type that you want to compare.
     * @param rhs A value of any type that you want to compare.
     */
    public static software.amazon.awscdk.ICfnConditionExpression conditionEquals(@javax.annotation.Nullable final java.lang.Object lhs, @javax.annotation.Nullable final java.lang.Object rhs) {
        return software.amazon.jsii.JsiiObject.jsiiStaticCall(software.amazon.awscdk.Fn.class, "conditionEquals", software.amazon.awscdk.ICfnConditionExpression.class, new Object[] { lhs, rhs });
    }

    /**
     * Returns one value if the specified condition evaluates to true and another value if the specified condition evaluates to false.
     * 
     * Currently, AWS
     * CloudFormation supports the ``Fn::If`` intrinsic function in the metadata
     * attribute, update policy attribute, and property values in the Resources
     * section and Outputs sections of a template. You can use the AWS::NoValue
     * pseudo parameter as a return value to remove the corresponding property.
     * 
     * @return an FnCondition token
     * @param conditionId A reference to a condition in the Conditions section.
     * @param valueIfTrue A value to be returned if the specified condition evaluates to true.
     * @param valueIfFalse A value to be returned if the specified condition evaluates to false.
     */
    public static software.amazon.awscdk.ICfnConditionExpression conditionIf(final java.lang.String conditionId, @javax.annotation.Nullable final java.lang.Object valueIfTrue, @javax.annotation.Nullable final java.lang.Object valueIfFalse) {
        return software.amazon.jsii.JsiiObject.jsiiStaticCall(software.amazon.awscdk.Fn.class, "conditionIf", software.amazon.awscdk.ICfnConditionExpression.class, new Object[] { java.util.Objects.requireNonNull(conditionId, "conditionId is required"), valueIfTrue, valueIfFalse });
    }

    /**
     * Returns true for a condition that evaluates to false or returns false for a condition that evaluates to true.
     * 
     * ``Fn::Not`` acts as a NOT operator.
     * 
     * @return an FnCondition token
     * @param condition A condition such as ``Fn::Equals`` that evaluates to true or false.
     */
    public static software.amazon.awscdk.ICfnConditionExpression conditionNot(final software.amazon.awscdk.ICfnConditionExpression condition) {
        return software.amazon.jsii.JsiiObject.jsiiStaticCall(software.amazon.awscdk.Fn.class, "conditionNot", software.amazon.awscdk.ICfnConditionExpression.class, new Object[] { java.util.Objects.requireNonNull(condition, "condition is required") });
    }

    /**
     * Returns true if any one of the specified conditions evaluate to true, or returns false if all of the conditions evaluates to false.
     * 
     * ``Fn::Or`` acts
     * as an OR operator. The minimum number of conditions that you can include is
     * 2, and the maximum is 10.
     * 
     * @return an FnCondition token
     * @param conditions conditions that evaluates to true or false.
     */
    public static software.amazon.awscdk.ICfnConditionExpression conditionOr(final software.amazon.awscdk.ICfnConditionExpression... conditions) {
        return software.amazon.jsii.JsiiObject.jsiiStaticCall(software.amazon.awscdk.Fn.class, "conditionOr", software.amazon.awscdk.ICfnConditionExpression.class, java.util.Arrays.stream(conditions).toArray(Object[]::new));
    }

    /**
     * The intrinsic function ``Fn::FindInMap`` returns the value corresponding to keys in a two-level map that is declared in the Mappings section.
     * 
     * @return a token represented as a string
     */
    public static java.lang.String findInMap(final java.lang.String mapName, final java.lang.String topLevelKey, final java.lang.String secondLevelKey) {
        return software.amazon.jsii.JsiiObject.jsiiStaticCall(software.amazon.awscdk.Fn.class, "findInMap", java.lang.String.class, new Object[] { java.util.Objects.requireNonNull(mapName, "mapName is required"), java.util.Objects.requireNonNull(topLevelKey, "topLevelKey is required"), java.util.Objects.requireNonNull(secondLevelKey, "secondLevelKey is required") });
    }

    /**
     * The ``Fn::GetAtt`` intrinsic function returns the value of an attribute from a resource in the template.
     * 
     * @return a CloudFormationToken object
     * @param logicalNameOfResource The logical name (also called logical ID) of the resource that contains the attribute that you want.
     * @param attributeName The name of the resource-specific attribute whose value you want.
     */
    public static software.amazon.awscdk.Token getAtt(final java.lang.String logicalNameOfResource, final java.lang.String attributeName) {
        return software.amazon.jsii.JsiiObject.jsiiStaticCall(software.amazon.awscdk.Fn.class, "getAtt", software.amazon.awscdk.Token.class, new Object[] { java.util.Objects.requireNonNull(logicalNameOfResource, "logicalNameOfResource is required"), java.util.Objects.requireNonNull(attributeName, "attributeName is required") });
    }

    /**
     * The intrinsic function ``Fn::GetAZs`` returns an array that lists Availability Zones for a specified region.
     * 
     * Because customers have access to
     * different Availability Zones, the intrinsic function ``Fn::GetAZs`` enables
     * template authors to write templates that adapt to the calling user's
     * access. That way you don't have to hard-code a full list of Availability
     * Zones for a specified region.
     * 
     * @return a token represented as a string array
     * @param region The name of the region for which you want to get the Availability Zones.
     */
    public static java.util.List getAZs(@javax.annotation.Nullable final java.lang.String region) {
        return software.amazon.jsii.JsiiObject.jsiiStaticCall(software.amazon.awscdk.Fn.class, "getAZs", java.util.List.class, new Object[] { region });
    }

    /**
     * The intrinsic function ``Fn::GetAZs`` returns an array that lists Availability Zones for a specified region.
     * 
     * Because customers have access to
     * different Availability Zones, the intrinsic function ``Fn::GetAZs`` enables
     * template authors to write templates that adapt to the calling user's
     * access. That way you don't have to hard-code a full list of Availability
     * Zones for a specified region.
     * 
     * @return a token represented as a string array
     */
    public static java.util.List getAZs() {
        return software.amazon.jsii.JsiiObject.jsiiStaticCall(software.amazon.awscdk.Fn.class, "getAZs", java.util.List.class);
    }

    /**
     * The intrinsic function ``Fn::ImportValue`` returns the value of an output exported by another stack.
     * 
     * You typically use this function to create
     * cross-stack references. In the following example template snippets, Stack A
     * exports VPC security group values and Stack B imports them.
     * 
     * @return a token represented as a string
     * @param sharedValueToImport The stack output value that you want to import.
     */
    public static java.lang.String importValue(final java.lang.String sharedValueToImport) {
        return software.amazon.jsii.JsiiObject.jsiiStaticCall(software.amazon.awscdk.Fn.class, "importValue", java.lang.String.class, new Object[] { java.util.Objects.requireNonNull(sharedValueToImport, "sharedValueToImport is required") });
    }

    /**
     * The intrinsic function ``Fn::Join`` appends a set of values into a single value, separated by the specified delimiter.
     * 
     * If a delimiter is the empty
     * string, the set of values are concatenated with no delimiter.
     * 
     * @return a token represented as a string
     * @param delimiter The value you want to occur between fragments.
     * @param listOfValues The list of values you want combined.
     */
    public static java.lang.String join(final java.lang.String delimiter, final java.util.List listOfValues) {
        return software.amazon.jsii.JsiiObject.jsiiStaticCall(software.amazon.awscdk.Fn.class, "join", java.lang.String.class, new Object[] { java.util.Objects.requireNonNull(delimiter, "delimiter is required"), java.util.Objects.requireNonNull(listOfValues, "listOfValues is required") });
    }

    /**
     * The intrinsic function ``Fn::Select`` returns a single object from a list of objects by index.
     * 
     * @return a token represented as a string
     * @param index The index of the object to retrieve.
     * @param array The list of objects to select from.
     */
    public static java.lang.String select(final java.lang.Number index, final java.util.List array) {
        return software.amazon.jsii.JsiiObject.jsiiStaticCall(software.amazon.awscdk.Fn.class, "select", java.lang.String.class, new Object[] { java.util.Objects.requireNonNull(index, "index is required"), java.util.Objects.requireNonNull(array, "array is required") });
    }

    /**
     * To split a string into a list of string values so that you can select an element from the resulting string list, use the ``Fn::Split`` intrinsic function.
     * 
     * Specify the location of splits
     * with a delimiter, such as , (a comma). After you split a string, use the ``Fn::Select`` function
     * to pick a specific element.
     * 
     * @return a token represented as a string array
     * @param delimiter A string value that determines where the source string is divided.
     * @param source The string value that you want to split.
     */
    public static java.util.List split(final java.lang.String delimiter, final java.lang.String source) {
        return software.amazon.jsii.JsiiObject.jsiiStaticCall(software.amazon.awscdk.Fn.class, "split", java.util.List.class, new Object[] { java.util.Objects.requireNonNull(delimiter, "delimiter is required"), java.util.Objects.requireNonNull(source, "source is required") });
    }

    /**
     * The intrinsic function ``Fn::Sub`` substitutes variables in an input string with values that you specify.
     * 
     * In your templates, you can use this function
     * to construct commands or outputs that include values that aren't available
     * until you create or update a stack.
     * 
     * @return a token represented as a string
     * @param body A string with variables that AWS CloudFormation substitutes with their associated values at runtime.
     * @param variables The name of a variable that you included in the String parameter.
     */
    public static java.lang.String sub(final java.lang.String body, @javax.annotation.Nullable final java.util.Map variables) {
        return software.amazon.jsii.JsiiObject.jsiiStaticCall(software.amazon.awscdk.Fn.class, "sub", java.lang.String.class, new Object[] { java.util.Objects.requireNonNull(body, "body is required"), variables });
    }

    /**
     * The intrinsic function ``Fn::Sub`` substitutes variables in an input string with values that you specify.
     * 
     * In your templates, you can use this function
     * to construct commands or outputs that include values that aren't available
     * until you create or update a stack.
     * 
     * @return a token represented as a string
     * @param body A string with variables that AWS CloudFormation substitutes with their associated values at runtime.
     */
    public static java.lang.String sub(final java.lang.String body) {
        return software.amazon.jsii.JsiiObject.jsiiStaticCall(software.amazon.awscdk.Fn.class, "sub", java.lang.String.class, new Object[] { java.util.Objects.requireNonNull(body, "body is required") });
    }

    /**
     * Returns true if a specified string matches all values in a list.
     * 
     * @return an FnCondition token
     * @param listOfStrings A list of strings, such as "A", "B", "C".
     * @param value A string, such as "A", that you want to compare against a list of strings.
     */
    public software.amazon.awscdk.ICfnConditionExpression conditionEachMemberEquals(final java.util.List listOfStrings, final java.lang.String value) {
        return this.jsiiCall("conditionEachMemberEquals", software.amazon.awscdk.ICfnConditionExpression.class, new Object[] { java.util.Objects.requireNonNull(listOfStrings, "listOfStrings is required"), java.util.Objects.requireNonNull(value, "value is required") });
    }

    /**
     * Returns true if each member in a list of strings matches at least one value in a second list of strings.
     * 
     * @return an FnCondition token
     * @param stringsToCheck A list of strings, such as "A", "B", "C".
     * @param stringsToMatch A list of strings, such as "A", "B", "C".
     */
    public software.amazon.awscdk.ICfnConditionExpression conditionEachMemberIn(final java.util.List stringsToCheck, final java.lang.String stringsToMatch) {
        return this.jsiiCall("conditionEachMemberIn", software.amazon.awscdk.ICfnConditionExpression.class, new Object[] { java.util.Objects.requireNonNull(stringsToCheck, "stringsToCheck is required"), java.util.Objects.requireNonNull(stringsToMatch, "stringsToMatch is required") });
    }

    /**
     * Returns all values for a specified parameter type.
     * 
     * @return a token represented as a string array
     * @param parameterType An AWS-specific parameter type, such as AWS::EC2::SecurityGroup::Id or AWS::EC2::VPC::Id.
     */
    public java.util.List refAll(final java.lang.String parameterType) {
        return this.jsiiCall("refAll", java.util.List.class, new Object[] { java.util.Objects.requireNonNull(parameterType, "parameterType is required") });
    }

    /**
     * Returns an attribute value or list of values for a specific parameter and attribute.
     * 
     * @return a token represented as a string
     * @param parameterOrLogicalId The name of a parameter for which you want to retrieve attribute values.
     * @param attribute The name of an attribute from which you want to retrieve a value.
     */
    public java.lang.String valueOf(final java.lang.String parameterOrLogicalId, final java.lang.String attribute) {
        return this.jsiiCall("valueOf", java.lang.String.class, new Object[] { java.util.Objects.requireNonNull(parameterOrLogicalId, "parameterOrLogicalId is required"), java.util.Objects.requireNonNull(attribute, "attribute is required") });
    }

    /**
     * Returns a list of all attribute values for a given parameter type and attribute.
     * 
     * @return a token represented as a string array
     * @param parameterType An AWS-specific parameter type, such as AWS::EC2::SecurityGroup::Id or AWS::EC2::VPC::Id.
     * @param attribute The name of an attribute from which you want to retrieve a value.
     */
    public java.util.List valueOfAll(final java.lang.String parameterType, final java.lang.String attribute) {
        return this.jsiiCall("valueOfAll", java.util.List.class, new Object[] { java.util.Objects.requireNonNull(parameterType, "parameterType is required"), java.util.Objects.requireNonNull(attribute, "attribute is required") });
    }
}