-
Notifications
You must be signed in to change notification settings - Fork 612
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
Codegen aws-sdk-go-v2 clients #4406
Conversation
aws-sdk-go-v2/Dockerfile
Outdated
RUN go env -w GOPROXY=direct | ||
|
||
RUN apt-get update && \ | ||
apt-get install -y --no-install-recommends openjdk-17-jdk |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
JDK 17 is pretty old at this point, since this is a new dockerfile is there any reason we cant use something newer? Would jdk-23 work?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated it to install OpenJDK 23 via Amazon Coretto in 9685bbf (the base image is Debian Bookworm, which doesn't support anything newer than OpenJDK 17).
9685bbf
to
718bddb
Compare
718bddb
to
7ddda43
Compare
7ddda43
to
108eb06
Compare
108eb06
to
bb6adf8
Compare
Summary
Add support for generating our own bespoke ECS client that's compatible with
aws-sdk-go-v2
.Implementation details
aws-sdk-go-v2
uses the Smithy Gradle plugin to generate client code.At a high level, the SDK
smithy-build.json
files for every JSON model in theaws-models
directorysmithy-build.json
filesgo.mod
files for each service packageWe simulate this process by building a Docker image with
smithy-go
)smithy-go
Gradle pluginaws-sdk-go-v2
repoand then volume mounting the
aws-sdk-go-v2/aws-models
andaws-sdk-go-v2/service
directories to the container. When the container runs, it reads the JSON models fromaws-sdk-go-v2/aws-models
and writes the generated client code andgo.mod
files to packages inaws-sdk-go-v2/service
.Notes
aws-sdk-go-v2/aws-models
directory currently contains our bespokeecs.json
model. If we need more custom clients in the future, we add their JSON models to this directory.aws-sdk-go-v2/service
directory only contains anecs
package since we currently only generate an ECS client.make gogenerate-aws-sdk
.ecs
package and the SDK's:go.mod
usesreplace
directives to reference other modules in the repo. Ours does not because, while our clients are customized, their dependencies should still be the official SDK modules.github.com/aws/aws-sdk-go-v2/service/${service}
because they import packages internal togithub.com/aws/aws-sdk-go-v2
.ecs-agent
andagent
go modules will eventually use our bespoke ECS client by depending on our localaws-sdk-go-v2/service/ecs
module. They should continue depending on officialaws-sdk-go-v2
modules for everything else, however. This can be accomplished withreplace
directives, e.g.Testing
This PR only includes codegen changes and the generated ECS client. The client is not used anywhere yet.
In a separate branch, I have replaced our
aws-sdk-go
ECS client with our bespokeaws-sdk-go-v2
ECS client and tested that everything compiles.New tests cover the changes: no
Licensing
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.