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

List bucket support #1560

Closed
wants to merge 4 commits into from
Closed

Conversation

daddykotex
Copy link
Contributor

@daddykotex daddykotex commented Jun 11, 2024

This is a subset of #1496 for that should make #1512 work.

I've tried it locally and with the right dependencies (s3 spec) and the right sbt configuration to toggle codegen for it, I can run the following:

package smithy4s.sandbox.aws

import cats.effect._
import org.http4s.ember.client._
import smithy4s.aws.AwsRegion
import smithy4s.aws.AwsClient
import com.amazonaws.{s3 => smithyS3}
import smithy4s.aws.AwsEnvironment

object S3ListFail extends IOApp.Simple {
  import smithyS3._

  val awsEnv =
    for {
      cl <- EmberClientBuilder.default[IO].build
      env <- AwsEnvironment.default(cl, AwsRegion.US_WEST_1)
    } yield env

  def run: IO[Unit] =
    awsEnv
      .flatMap(env => AwsClient(S3, env))
      .use { case s3 =>
        s3.listBuckets()
      }
      .flatMap(IO.println(_))
}
[info] running (fork) smithy4s.sandbox.aws.S3ListFail 
[info] ListBucketsOutput(Some(List(Bucket(Some(readonlyaccess-99238<redacted>),Some(2024-06-10T16:10:29Z)))),Some(Owner(Some(<redacted>),Some(58c87a76c5d2029b0c2c096f57a27e7935b8b3074<redacted>))))

I quickly tried to list the objects of the first bucket I got as a result but it did not work

EDIT: it works, I was just targeting the wrong region

PR Checklist (not all items are relevant to all PRs)

  • Added unit-tests (for runtime code)
  • Added bootstrapped code + smoke tests (when the rendering logic is modified)
  • Added build-plugins integration tests (when reflection loading is required at codegen-time)
  • Added alloy compliance tests (when simpleRestJson protocol behaviour is expanded/updated)
  • Updated dynamic module to match generated-code behaviour
  • Added documentation
  • Updated changelog

@daddykotex daddykotex changed the title Dfrancoeur/aws list support List bucket support Jun 11, 2024
@daddykotex daddykotex marked this pull request as draft June 11, 2024 03:53
@Baccata
Copy link
Contributor

Baccata commented Oct 2, 2024

I'm closing this one, and opening an alternative one that does sign the bodies. This PR was used as a source of inspiration though.

@Baccata Baccata closed this Oct 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants