Skip to content

Commit

Permalink
Support implicitGlobalRegion
Browse files Browse the repository at this point in the history
  • Loading branch information
lauzadis committed Jun 18, 2024
1 parent af41ebf commit 8c9e46b
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ public data class PartitionConfig(
public val dualStackDnsSuffix: String? = null,
public val supportsFIPS: Boolean? = null,
public val supportsDualStack: Boolean? = null,
public val implicitGlobalRegion: String? = null,
) {
public fun mergeWith(other: PartitionConfig): PartitionConfig =
PartitionConfig(
Expand All @@ -75,6 +76,7 @@ public data class PartitionConfig(
other.dualStackDnsSuffix ?: dualStackDnsSuffix,
other.supportsFIPS ?: supportsFIPS,
other.supportsDualStack ?: supportsDualStack,
other.implicitGlobalRegion ?: implicitGlobalRegion,
)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ class FunctionsTest {
"us-west-2" to PartitionConfig(),
"aws-global" to PartitionConfig(
dnsSuffix = "override.amazonaws.com",
implicitGlobalRegion = "implicit-global-region"
),
),
baseConfig = PartitionConfig(
Expand Down Expand Up @@ -144,6 +145,7 @@ class FunctionsTest {
dualStackDnsSuffix = "api.aws",
supportsFIPS = true,
supportsDualStack = true,
implicitGlobalRegion = "implicit-global-region"
),
actual = partition(testPartitions, "aws-global"),
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,9 @@ class PartitionsGenerator(
regionConfig.getBooleanMember("supportsDualStack").ifPresent {
write("supportsDualStack = #L,", it.value)
}
regionConfig.getStringMember("implicitGlobalRegion").ifPresent {
write("implicitGlobalRegion = #S,", it.value)
}
}
}
}
Expand All @@ -90,6 +93,7 @@ class PartitionsGenerator(
write("dualStackDnsSuffix = #S,", baseConfig.expectStringMember("dualStackDnsSuffix").value)
write("supportsFIPS = #L,", baseConfig.expectBooleanMember("supportsFIPS").value)
write("supportsDualStack = #L,", baseConfig.expectBooleanMember("supportsDualStack").value)
write("implicitGlobalRegion = #S,", baseConfig.expectStringMember("implicitGlobalRegion").value)
}
}
}
Expand Down

0 comments on commit 8c9e46b

Please sign in to comment.