Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add snippet tags to pickup bucket creation #6060

Merged
merged 2 commits into from
Feb 6, 2024
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -189,8 +189,10 @@ class MrapExample {
}
// snippet-end:[s3.kotlin.mrap.create-s3controlclient]

// snippet-start:[s3.kotlin.mrap.create-buckets]
suspend fun setUpTwoBuckets(s3: S3Client, bucketName1: String, bucketName2: String) {
println("Create two buckets in different regions.")
// The shared aws config file configures the default Region to be us-east-1.
s3.createBucket(
CreateBucketRequest {
bucket = bucketName1
Expand All @@ -199,7 +201,7 @@ class MrapExample {
s3.waitUntilBucketExists { bucket = bucketName1 }
println(" Bucket [$bucketName1] created.")

// Override the S3Client to work with us-west-1.
// Override the S3Client to work with us-west-1 for the second bucket.
s3.withConfig {
region = "us-west-1"
}.use { s3West ->
Expand All @@ -215,6 +217,7 @@ class MrapExample {
println(" Bucket [$bucketName2] created.")
}
}
// snippet-end:[s3.kotlin.mrap.create-buckets]

suspend fun getAccountId(): String {
StsClient.fromEnvironment()
Expand Down
Loading