Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changes/220eb2c9-2f5b-4ebb-bc30-901bdedc1a4c.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"id": "220eb2c9-2f5b-4ebb-bc30-901bdedc1a4c",
"type": "bugfix",
"description": "⚠️ **IMPORTANT**: Update to the latest S3 model, which correctly models `ReplicationRuleFilter` and `LifecycleRuleFilter` as structures (not unions). This may cause compilation failures in existing code which references these two shapes."
}
4 changes: 2 additions & 2 deletions codegen/sdk/aws-models/s3.json
Original file line number Diff line number Diff line change
Expand Up @@ -26084,7 +26084,7 @@
}
},
"com.amazonaws.s3#LifecycleRuleFilter": {
"type": "union",
"type": "structure",
"members": {
"Prefix": {
"target": "com.amazonaws.s3#Prefix",
Expand Down Expand Up @@ -32311,7 +32311,7 @@
}
},
"com.amazonaws.s3#ReplicationRuleFilter": {
"type": "union",
"type": "structure",
"members": {
"Prefix": {
"target": "com.amazonaws.s3#Prefix",
Expand Down
8 changes: 5 additions & 3 deletions services/s3/e2eTest/src/MutliRegionAccessPointTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import aws.sdk.kotlin.e2etest.S3TestUtils.createMultiRegionAccessPoint
import aws.sdk.kotlin.e2etest.S3TestUtils.deleteBucketAndAllContents
import aws.sdk.kotlin.e2etest.S3TestUtils.deleteMultiRegionAccessPoint
import aws.sdk.kotlin.e2etest.S3TestUtils.getAccountId
import aws.sdk.kotlin.e2etest.S3TestUtils.getBucketWithPrefix
import aws.sdk.kotlin.e2etest.S3TestUtils.getMultiRegionAccessPointArn
import aws.sdk.kotlin.e2etest.S3TestUtils.getTestBucket
import aws.sdk.kotlin.e2etest.S3TestUtils.multiRegionAccessPointWasCreated
import aws.sdk.kotlin.services.s3.S3Client
import aws.sdk.kotlin.services.s3.deleteObject
Expand All @@ -27,6 +27,8 @@ import kotlin.test.Test
import kotlin.test.assertEquals
import kotlin.test.assertFailsWith

private const val MRAP_BUCKET_PREFIX = "s3-mrap-test-bucket-"

@TestInstance(TestInstance.Lifecycle.PER_CLASS)
class MutliRegionAccessPointTest {
private val s3West = S3Client { region = "us-west-2" }
Expand All @@ -45,8 +47,8 @@ class MutliRegionAccessPointTest {
@BeforeAll
private fun setUp(): Unit = runBlocking {
accountId = getAccountId()
usWestBucket = getTestBucket(s3West, "us-west-2", accountId)
usEastBucket = getTestBucket(s3East, "us-east-2", accountId)
usWestBucket = getBucketWithPrefix(s3West, MRAP_BUCKET_PREFIX, "us-west-2", accountId)
usEastBucket = getBucketWithPrefix(s3East, MRAP_BUCKET_PREFIX, "us-east-2", accountId)

createMultiRegionAccessPoint(
s3Control,
Expand Down
9 changes: 4 additions & 5 deletions services/s3/e2eTest/src/S3TestUtils.kt
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import aws.sdk.kotlin.services.s3.model.*
import aws.sdk.kotlin.services.s3.model.BucketLocationConstraint
import aws.sdk.kotlin.services.s3.model.ExpirationStatus
import aws.sdk.kotlin.services.s3.model.LifecycleRule
import aws.sdk.kotlin.services.s3.model.LifecycleRuleFilter
import aws.sdk.kotlin.services.s3.paginators.listObjectsV2Paginated
import aws.sdk.kotlin.services.s3.waiters.waitUntilBucketExists
import aws.sdk.kotlin.services.s3.waiters.waitUntilBucketNotExists
Expand Down Expand Up @@ -46,11 +45,11 @@ object S3TestUtils {
accountId: String? = null,
): String = getBucketWithPrefix(client, TEST_BUCKET_PREFIX, region, accountId)

private suspend fun getBucketWithPrefix(
suspend fun getBucketWithPrefix(
client: S3Client,
prefix: String,
region: String?,
accountId: String?,
region: String? = null,
accountId: String? = null,
): String = withTimeout(60.seconds) {
val buckets = client.listBuckets()
.buckets
Expand Down Expand Up @@ -88,7 +87,7 @@ object S3TestUtils {
rules = listOf(
LifecycleRule {
expiration { days = 1 }
filter = LifecycleRuleFilter.Prefix("")
filter { this.prefix = "" }
status = ExpirationStatus.Enabled
id = "delete-old"
},
Expand Down
Loading