Class: AWSCDK::Fn

Inherits:
Jsii::Object
  • Object
show all
Defined in:
fn.rb

Overview

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(*args) ⇒ Fn

Returns a new instance of Fn.

Raises:

  • (NoMethodError)


10
11
12
# File 'fn.rb', line 10

def initialize(*args)
  raise NoMethodError, "aws-cdk-lib.Fn does not have a visible constructor; use the provided factory methods"
end

Class Method Details

.base64(data) ⇒ String

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.

Parameters:

  • data (String)

    The string value you want to convert to Base64.

Returns:

  • (String)

    a token represented as a string



26
27
28
29
# File 'fn.rb', line 26

def self.base64(data)
  Jsii::Type.check_type(data, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "data")
  Jsii::Kernel.instance.call_static("aws-cdk-lib.Fn", "base64", [data])
end

.cidr(ip_block, count, size_mask = nil) ⇒ Array<String>

The intrinsic function Fn::Cidr returns the specified Cidr address block.

Parameters:

  • ip_block (String)

    The user-specified default Cidr address block.

  • count (Numeric)

    The number of subnets' Cidr block wanted.

  • size_mask (String, nil) (defaults to: nil)

    The digit covered in the subnet.

Returns:

  • (Array<String>)

    a token represented as a string



37
38
39
40
41
42
# File 'fn.rb', line 37

def self.cidr(ip_block, count, size_mask = nil)
  Jsii::Type.check_type(ip_block, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "ipBlock")
  Jsii::Type.check_type(count, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "count")
  Jsii::Type.check_type(size_mask, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "sizeMask") unless size_mask.nil?
  Jsii::Kernel.instance.call_static("aws-cdk-lib.Fn", "cidr", [ip_block, count, size_mask])
end

.condition_and(*conditions) ⇒ AWSCDK::ICfnRuleConditionExpression

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 1.

Parameters:

Returns:



52
53
54
55
56
57
# File 'fn.rb', line 52

def self.condition_and(*conditions)
  conditions.each_with_index do |item, index|
    Jsii::Type.check_type(item, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5JQ2ZuQ29uZGl0aW9uRXhwcmVzc2lvbiJ9")), "conditions[#{index}]")
  end
  Jsii::Kernel.instance.call_static("aws-cdk-lib.Fn", "conditionAnd", [*conditions])
end

.condition_contains(list_of_strings, value) ⇒ AWSCDK::ICfnRuleConditionExpression

Returns true if a specified string matches at least one value in a list of strings.

Parameters:

  • list_of_strings (Array<String>)

    A list of strings, such as "A", "B", "C".

  • value (String)

    A string, such as "A", that you want to compare against a list of strings.

Returns:



64
65
66
67
68
# File 'fn.rb', line 64

def self.condition_contains(list_of_strings, value)
  Jsii::Type.check_type(list_of_strings, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7InByaW1pdGl2ZSI6InN0cmluZyJ9LCJraW5kIjoiYXJyYXkifX0=")), "listOfStrings")
  Jsii::Type.check_type(value, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "value")
  Jsii::Kernel.instance.call_static("aws-cdk-lib.Fn", "conditionContains", [list_of_strings, value])
end

.condition_each_member_equals(list_of_strings, value) ⇒ AWSCDK::ICfnRuleConditionExpression

Returns true if a specified string matches all values in a list.

Parameters:

  • list_of_strings (Array<String>)

    A list of strings, such as "A", "B", "C".

  • value (String)

    A string, such as "A", that you want to compare against a list of strings.

Returns:



75
76
77
78
79
# File 'fn.rb', line 75

def self.condition_each_member_equals(list_of_strings, value)
  Jsii::Type.check_type(list_of_strings, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7InByaW1pdGl2ZSI6InN0cmluZyJ9LCJraW5kIjoiYXJyYXkifX0=")), "listOfStrings")
  Jsii::Type.check_type(value, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "value")
  Jsii::Kernel.instance.call_static("aws-cdk-lib.Fn", "conditionEachMemberEquals", [list_of_strings, value])
end

.condition_each_member_in(strings_to_check, strings_to_match) ⇒ AWSCDK::ICfnRuleConditionExpression

Returns true if each member in a list of strings matches at least one value in a second list of strings.

Parameters:

  • strings_to_check (Array<String>)

    A list of strings, such as "A", "B", "C".

  • strings_to_match (Array<String>)

    A list of strings, such as "A", "B", "C".

Returns:



86
87
88
89
90
# File 'fn.rb', line 86

def self.condition_each_member_in(strings_to_check, strings_to_match)
  Jsii::Type.check_type(strings_to_check, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7InByaW1pdGl2ZSI6InN0cmluZyJ9LCJraW5kIjoiYXJyYXkifX0=")), "stringsToCheck")
  Jsii::Type.check_type(strings_to_match, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7InByaW1pdGl2ZSI6InN0cmluZyJ9LCJraW5kIjoiYXJyYXkifX0=")), "stringsToMatch")
  Jsii::Kernel.instance.call_static("aws-cdk-lib.Fn", "conditionEachMemberIn", [strings_to_check, strings_to_match])
end

.condition_equals(lhs, rhs) ⇒ AWSCDK::ICfnRuleConditionExpression

Compares if two values are equal.

Returns true if the two values are equal or false if they aren't.

Parameters:

  • lhs (Object)

    A value of any type that you want to compare.

  • rhs (Object)

    A value of any type that you want to compare.

Returns:



100
101
102
103
104
# File 'fn.rb', line 100

def self.condition_equals(lhs, rhs)
  Jsii::Type.check_type(lhs, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJhbnkifQ==")), "lhs")
  Jsii::Type.check_type(rhs, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJhbnkifQ==")), "rhs")
  Jsii::Kernel.instance.call_static("aws-cdk-lib.Fn", "conditionEquals", [lhs, rhs])
end

.condition_if(condition_id, value_if_true, value_if_false) ⇒ AWSCDK::ICfnRuleConditionExpression

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.

Parameters:

  • condition_id (String)

    A reference to a condition in the Conditions section.

  • value_if_true (Object)

    A value to be returned if the specified condition evaluates to true.

  • value_if_false (Object)

    A value to be returned if the specified condition evaluates to false.

Returns:



118
119
120
121
122
123
# File 'fn.rb', line 118

def self.condition_if(condition_id, value_if_true, value_if_false)
  Jsii::Type.check_type(condition_id, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "conditionId")
  Jsii::Type.check_type(value_if_true, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJhbnkifQ==")), "valueIfTrue")
  Jsii::Type.check_type(value_if_false, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJhbnkifQ==")), "valueIfFalse")
  Jsii::Kernel.instance.call_static("aws-cdk-lib.Fn", "conditionIf", [condition_id, value_if_true, value_if_false])
end

.condition_not(condition) ⇒ AWSCDK::ICfnRuleConditionExpression

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.

Parameters:

Returns:



131
132
133
134
# File 'fn.rb', line 131

def self.condition_not(condition)
  Jsii::Type.check_type(condition, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5JQ2ZuQ29uZGl0aW9uRXhwcmVzc2lvbiJ9")), "condition")
  Jsii::Kernel.instance.call_static("aws-cdk-lib.Fn", "conditionNot", [condition])
end

.condition_or(*conditions) ⇒ AWSCDK::ICfnRuleConditionExpression

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 1.

Parameters:

Returns:



144
145
146
147
148
149
# File 'fn.rb', line 144

def self.condition_or(*conditions)
  conditions.each_with_index do |item, index|
    Jsii::Type.check_type(item, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5JQ2ZuQ29uZGl0aW9uRXhwcmVzc2lvbiJ9")), "conditions[#{index}]")
  end
  Jsii::Kernel.instance.call_static("aws-cdk-lib.Fn", "conditionOr", [*conditions])
end

.find_in_map(map_name, top_level_key, second_level_key, default_value = nil) ⇒ String

The intrinsic function Fn::FindInMap returns the value corresponding to keys in a two-level map that is declared in the Mappings section.

Warning: do not use with lazy mappings as this function will not guarantee a lazy mapping to render in the template. Prefer to use CfnMapping.findInMap in general.

Parameters:

  • map_name (String)
  • top_level_key (String)
  • second_level_key (String)
  • default_value (String, nil) (defaults to: nil)

Returns:

  • (String)

    a token represented as a string



161
162
163
164
165
166
167
# File 'fn.rb', line 161

def self.find_in_map(map_name, top_level_key, second_level_key, default_value = nil)
  Jsii::Type.check_type(map_name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "mapName")
  Jsii::Type.check_type(top_level_key, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "topLevelKey")
  Jsii::Type.check_type(second_level_key, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "secondLevelKey")
  Jsii::Type.check_type(default_value, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "defaultValue") unless default_value.nil?
  Jsii::Kernel.instance.call_static("aws-cdk-lib.Fn", "findInMap", [map_name, top_level_key, second_level_key, default_value])
end

.get_att(logical_name_of_resource, attribute_name) ⇒ AWSCDK::IResolvable

The Fn::GetAtt intrinsic function returns the value of an attribute from a resource in the template.

Parameters:

  • logical_name_of_resource (String)

    The logical name (also called logical ID) of the resource that contains the attribute that you want.

  • attribute_name (String)

    The name of the resource-specific attribute whose value you want.

Returns:



174
175
176
177
178
# File 'fn.rb', line 174

def self.get_att(logical_name_of_resource, attribute_name)
  Jsii::Type.check_type(logical_name_of_resource, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "logicalNameOfResource")
  Jsii::Type.check_type(attribute_name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "attributeName")
  Jsii::Kernel.instance.call_static("aws-cdk-lib.Fn", "getAtt", [logical_name_of_resource, attribute_name])
end

.get_azs(region = nil) ⇒ Array<String>

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.

Parameters:

  • region (String, nil) (defaults to: nil)

    The name of the region for which you want to get the Availability Zones.

Returns:

  • (Array<String>)

    a token represented as a string array



190
191
192
193
# File 'fn.rb', line 190

def self.get_azs(region = nil)
  Jsii::Type.check_type(region, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "region") unless region.nil?
  Jsii::Kernel.instance.call_static("aws-cdk-lib.Fn", "getAzs", [region])
end

.get_stack_output(stack_name, output_name, region = nil, role_arn = nil) ⇒ String

The intrinsic function Fn::GetStackOutput returns the value of an output from another stack.

This is similar to Fn::ImportValue, but it can reference a normal output, without the need to export anything. As with Fn::ImportValue, you typically use this function to create cross-stack references.

Parameters:

  • stack_name (String)

    The name of the producer stack.

  • output_name (String)

    The name of the output to get the value from.

  • region (String, nil) (defaults to: nil)

    The region where the producer stack is deployed.

  • role_arn (String, nil) (defaults to: nil)

    The role to be used when describing the producer stack.

Returns:

  • (String)


206
207
208
209
210
211
212
# File 'fn.rb', line 206

def self.get_stack_output(stack_name, output_name, region = nil, role_arn = nil)
  Jsii::Type.check_type(stack_name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "stackName")
  Jsii::Type.check_type(output_name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "outputName")
  Jsii::Type.check_type(region, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "region") unless region.nil?
  Jsii::Type.check_type(role_arn, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "roleArn") unless role_arn.nil?
  Jsii::Kernel.instance.call_static("aws-cdk-lib.Fn", "getStackOutput", [stack_name, output_name, region, role_arn])
end

.import_list_value(shared_value_to_import, assumed_length, delimiter = nil) ⇒ Array<String>

Like Fn.importValue, but import a list with a known length.

If you explicitly want a list with an unknown length, call Fn.split(',', Fn.importValue(exportName)). See the documentation of Fn.split to read more about the limitations of using lists of unknown length.

Fn.importListValue(exportName, assumedLength) is the same as Fn.split(',', Fn.importValue(exportName), assumedLength), but easier to read and impossible to forget to pass assumed_length.

Parameters:

  • shared_value_to_import (String)
  • assumed_length (Numeric)
  • delimiter (String, nil) (defaults to: nil)

Returns:

  • (Array<String>)


227
228
229
230
231
232
# File 'fn.rb', line 227

def self.import_list_value(shared_value_to_import, assumed_length, delimiter = nil)
  Jsii::Type.check_type(shared_value_to_import, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "sharedValueToImport")
  Jsii::Type.check_type(assumed_length, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "assumedLength")
  Jsii::Type.check_type(delimiter, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "delimiter") unless delimiter.nil?
  Jsii::Kernel.instance.call_static("aws-cdk-lib.Fn", "importListValue", [shared_value_to_import, assumed_length, delimiter])
end

.import_value(shared_value_to_import) ⇒ String

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.

Parameters:

  • shared_value_to_import (String)

    The stack output value that you want to import.

Returns:

  • (String)

    a token represented as a string



242
243
244
245
# File 'fn.rb', line 242

def self.import_value(shared_value_to_import)
  Jsii::Type.check_type(shared_value_to_import, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "sharedValueToImport")
  Jsii::Kernel.instance.call_static("aws-cdk-lib.Fn", "importValue", [shared_value_to_import])
end

.join(delimiter, list_of_values) ⇒ String

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.

Parameters:

  • delimiter (String)

    The value you want to occur between fragments.

  • list_of_values (Array<String>)

    The list of values you want combined.

Returns:

  • (String)

    a token represented as a string



255
256
257
258
259
# File 'fn.rb', line 255

def self.join(delimiter, list_of_values)
  Jsii::Type.check_type(delimiter, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "delimiter")
  Jsii::Type.check_type(list_of_values, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7InByaW1pdGl2ZSI6InN0cmluZyJ9LCJraW5kIjoiYXJyYXkifX0=")), "listOfValues")
  Jsii::Kernel.instance.call_static("aws-cdk-lib.Fn", "join", [delimiter, list_of_values])
end

.jsii_overridable_methodsObject



14
15
16
17
# File 'fn.rb', line 14

def self.jsii_overridable_methods
  {
  }
end

.len(array) ⇒ Numeric

The intrinsic function Fn::Length returns the number of elements within an array or an intrinsic function that returns an array.

Parameters:

  • array (Object)

    The array you want to return the number of elements from.

Returns:

  • (Numeric)


265
266
267
268
# File 'fn.rb', line 265

def self.len(array)
  Jsii::Type.check_type(array, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJhbnkifQ==")), "array")
  Jsii::Kernel.instance.call_static("aws-cdk-lib.Fn", "len", [array])
end

.parse_domain_name(url) ⇒ String

Given an url, parse the domain name.

Parameters:

  • url (String)

    the url to parse.

Returns:

  • (String)


274
275
276
277
# File 'fn.rb', line 274

def self.parse_domain_name(url)
  Jsii::Type.check_type(url, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "url")
  Jsii::Kernel.instance.call_static("aws-cdk-lib.Fn", "parseDomainName", [url])
end

.ref(logical_name) ⇒ String

The Ref intrinsic function returns the value of the specified parameter or resource.

Note that it doesn't validate the logicalName, it mainly serves parameter/resource reference defined in a CfnInclude template.

Parameters:

  • logical_name (String)

    The logical name of a parameter/resource for which you want to retrieve its value.

Returns:

  • (String)


285
286
287
288
# File 'fn.rb', line 285

def self.ref(logical_name)
  Jsii::Type.check_type(logical_name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "logicalName")
  Jsii::Kernel.instance.call_static("aws-cdk-lib.Fn", "ref", [logical_name])
end

.ref_all(parameter_type) ⇒ Array<String>

Returns all values for a specified parameter type.

Parameters:

  • parameter_type (String)

    An AWS-specific parameter type, such as AWS::EC2::SecurityGroup::Id or AWS::EC2::VPC::Id.

Returns:

  • (Array<String>)

    a token represented as a string array



294
295
296
297
# File 'fn.rb', line 294

def self.ref_all(parameter_type)
  Jsii::Type.check_type(parameter_type, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "parameterType")
  Jsii::Kernel.instance.call_static("aws-cdk-lib.Fn", "refAll", [parameter_type])
end

.select(index, array) ⇒ String

The intrinsic function Fn::Select returns a single object from a list of objects by index.

Parameters:

  • index (Numeric)

    The index of the object to retrieve.

  • array (Array<String>)

    The list of objects to select from.

Returns:

  • (String)

    a token represented as a string



304
305
306
307
308
# File 'fn.rb', line 304

def self.select(index, array)
  Jsii::Type.check_type(index, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "index")
  Jsii::Type.check_type(array, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7InByaW1pdGl2ZSI6InN0cmluZyJ9LCJraW5kIjoiYXJyYXkifX0=")), "array")
  Jsii::Kernel.instance.call_static("aws-cdk-lib.Fn", "select", [index, array])
end

.split(delimiter, source, assumed_length = nil) ⇒ Array<String>

Split a string token into a token list of string values.

Specify the location of splits with a delimiter such as ',' (a comma). Renders to the Fn::Split intrinsic function.

Lists with unknown lengths (default)

Since this function is used to work with deploy-time values, if assumed_length is not given the CDK cannot know the length of the resulting list at synthesis time. This brings the following restrictions:

  • You must use Fn.select(i, list) to pick elements out of the list (you must not use list[i]).
  • You cannot add elements to the list, remove elements from the list, combine two such lists together, or take a slice of the list.
  • You cannot pass the list to constructs that do any of the above.

The only valid operation with such a tokenized list is to pass it unmodified to a CloudFormation Resource construct.

Lists with assumed lengths

Pass assumed_length if you know the length of the list that will be produced by splitting. The actual list length at deploy time may be longer than the number you pass, but not shorter.

The returned list will look like:

[Fn.select(0, split), Fn.select(1, split), Fn.select(2, split), ...]

The restrictions from the section "Lists with unknown lengths" will now be lifted, at the expense of having to know and fix the length of the list.

Parameters:

  • delimiter (String)

    A string value that determines where the source string is divided.

  • source (String)

    The string value that you want to split.

  • assumed_length (Numeric, nil) (defaults to: nil)

    The length of the list that will be produced by splitting.

Returns:

  • (Array<String>)

    a token represented as a string array



349
350
351
352
353
354
# File 'fn.rb', line 349

def self.split(delimiter, source, assumed_length = nil)
  Jsii::Type.check_type(delimiter, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "delimiter")
  Jsii::Type.check_type(source, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "source")
  Jsii::Type.check_type(assumed_length, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "assumedLength") unless assumed_length.nil?
  Jsii::Kernel.instance.call_static("aws-cdk-lib.Fn", "split", [delimiter, source, assumed_length])
end

.sub(body, variables = nil) ⇒ String

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.

Parameters:

  • body (String)

    A string with variables that AWS CloudFormation substitutes with their associated values at runtime.

  • variables (Hash{String => String}, nil) (defaults to: nil)

    The name of a variable that you included in the String parameter.

Returns:

  • (String)

    a token represented as a string



365
366
367
368
369
# File 'fn.rb', line 365

def self.sub(body, variables = nil)
  Jsii::Type.check_type(body, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "body")
  Jsii::Type.check_type(variables, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7InByaW1pdGl2ZSI6InN0cmluZyJ9LCJraW5kIjoibWFwIn19")), "variables") unless variables.nil?
  Jsii::Kernel.instance.call_static("aws-cdk-lib.Fn", "sub", [body, variables])
end

.to_json_string(object) ⇒ String

The Fn::ToJsonString intrinsic function converts an object or array to its corresponding JSON string.

Parameters:

  • object (Object)

    The object or array to stringify.

Returns:

  • (String)


375
376
377
378
# File 'fn.rb', line 375

def self.to_json_string(object)
  Jsii::Type.check_type(object, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJhbnkifQ==")), "object")
  Jsii::Kernel.instance.call_static("aws-cdk-lib.Fn", "toJsonString", [object])
end

.transform(macro_name, parameters) ⇒ AWSCDK::IResolvable

Creates a token representing the Fn::Transform expression.

Parameters:

  • macro_name (String)

    The name of the macro to perform the processing.

  • parameters (Hash{String => Object})

    The parameters to be passed to the macro.

Returns:

See Also:



386
387
388
389
390
# File 'fn.rb', line 386

def self.transform(macro_name, parameters)
  Jsii::Type.check_type(macro_name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "macroName")
  Jsii::Type.check_type(parameters, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7InByaW1pdGl2ZSI6ImFueSJ9LCJraW5kIjoibWFwIn19")), "parameters")
  Jsii::Kernel.instance.call_static("aws-cdk-lib.Fn", "transform", [macro_name, parameters])
end

.value_of(parameter_or_logical_id, attribute) ⇒ String

Returns an attribute value or list of values for a specific parameter and attribute.

Parameters:

  • parameter_or_logical_id (String)

    The name of a parameter for which you want to retrieve attribute values.

  • attribute (String)

    The name of an attribute from which you want to retrieve a value.

Returns:

  • (String)

    a token represented as a string



397
398
399
400
401
# File 'fn.rb', line 397

def self.value_of(parameter_or_logical_id, attribute)
  Jsii::Type.check_type(parameter_or_logical_id, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "parameterOrLogicalId")
  Jsii::Type.check_type(attribute, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "attribute")
  Jsii::Kernel.instance.call_static("aws-cdk-lib.Fn", "valueOf", [parameter_or_logical_id, attribute])
end

.value_of_all(parameter_type, attribute) ⇒ Array<String>

Returns a list of all attribute values for a given parameter type and attribute.

Parameters:

  • parameter_type (String)

    An AWS-specific parameter type, such as AWS::EC2::SecurityGroup::Id or AWS::EC2::VPC::Id.

  • attribute (String)

    The name of an attribute from which you want to retrieve a value.

Returns:

  • (Array<String>)

    a token represented as a string array



408
409
410
411
412
# File 'fn.rb', line 408

def self.value_of_all(parameter_type, attribute)
  Jsii::Type.check_type(parameter_type, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "parameterType")
  Jsii::Type.check_type(attribute, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "attribute")
  Jsii::Kernel.instance.call_static("aws-cdk-lib.Fn", "valueOfAll", [parameter_type, attribute])
end