Skip to content

Commit 7c25e82

Browse files
authored
Codegen aws-sdk-go-v2 clients (#4406)
1 parent 12cb750 commit 7c25e82

File tree

81 files changed

+72623
-2
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

81 files changed

+72623
-2
lines changed

Makefile

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,15 @@ gogenerate-init:
133133
PATH=$(PATH):$(shell pwd)/scripts go generate -x ./ecs-init/...
134134
$(MAKE) goimports
135135

136+
AWS_SDK_CODEGEN_IMAGE="amazon/aws-sdk-go-codegen"
137+
gogenerate-aws-sdk:
138+
@docker build --build-arg GO_VERSION=${GO_VERSION} -t $(AWS_SDK_CODEGEN_IMAGE) aws-sdk-go-v2
139+
@docker run \
140+
--volume "$(PWD)/aws-sdk-go-v2/aws-models:/go/src/github.com/aws/aws-sdk-go-v2/codegen/sdk-codegen/aws-models" \
141+
--volume "$(PWD)/aws-sdk-go-v2/service:/go/src/github.com/aws/aws-sdk-go-v2/service" \
142+
--rm \
143+
$(AWS_SDK_CODEGEN_IMAGE)
144+
136145
# 'go' may not be on the $PATH for sudo tests
137146
GO_EXECUTABLE=$(shell command -v go 2> /dev/null)
138147

@@ -506,8 +515,7 @@ clean-all: clean
506515
# for our dockerfree builds, we likely don't have docker
507516
# ensure docker is running and we can talk to it, abort if not:
508517
docker ps > /dev/null
509-
-docker rmi $(BUILDER_IMAGE) "amazon/amazon-ecs-agent-cleanbuild:make"
510-
-docker rmi $(BUILDER_IMAGE) "amazon/amazon-ecs-agent-cleanbuild-windows:make"
518+
-docker rmi $(BUILDER_IMAGE) "amazon/amazon-ecs-agent-cleanbuild:make" "amazon/amazon-ecs-agent-cleanbuild-windows:make" $(AWS_SDK_CODEGEN_IMAGE)
511519
-$(MAKE) -C misc/netkitten $(MFLAGS) clean
512520
-$(MAKE) -C misc/volumes-test $(MFLAGS) clean
513521
-$(MAKE) -C misc/exec-command-agent-test $(MFLAGS) clean

aws-sdk-go-v2/Dockerfile

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License"). You may
4+
# not use this file except in compliance with the License. A copy of the
5+
# License is located at
6+
#
7+
# http://aws.amazon.com/apache2.0/
8+
#
9+
# or in the "license" file accompanying this file. This file is distributed
10+
# on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
11+
# express or implied. See the License for the specific language governing
12+
# permissions and limitations under the License.
13+
14+
ARG GO_VERSION
15+
FROM public.ecr.aws/docker/library/golang:${GO_VERSION}
16+
17+
ENV XDG_CACHE_HOME /tmp
18+
19+
RUN go env -w GOPROXY=direct
20+
21+
# Install Amazon Coretto for OpenJDK 23.
22+
# https://docs.aws.amazon.com/corretto/latest/corretto-23-ug/generic-linux-install.html
23+
RUN wget -O - https://apt.corretto.aws/corretto.key | \
24+
gpg --dearmor -o /usr/share/keyrings/corretto-keyring.gpg && \
25+
echo "deb [signed-by=/usr/share/keyrings/corretto-keyring.gpg] https://apt.corretto.aws stable main" | \
26+
tee /etc/apt/sources.list.d/corretto.list
27+
28+
RUN apt-get update && \
29+
apt-get install -y --no-install-recommends java-23-amazon-corretto-jdk
30+
31+
RUN mkdir -p /go/src/github.com/aws/
32+
33+
RUN git clone https://github.com/aws/aws-sdk-go-v2.git /go/src/github.com/aws/aws-sdk-go-v2
34+
35+
WORKDIR /go/src/github.com/aws/aws-sdk-go-v2
36+
37+
# Remove test codegen directories to speed up the SDK codegen process.
38+
RUN rm -r codegen/protocol-test-codegen codegen/smithy-aws-go-codegen/src/test
39+
40+
RUN make smithy-go-publish-local
41+
42+
CMD ["make", "smithy-generate", "update-requires", "update-module-metadata", "min-go-version-service_.", "tidy-modules-service_."]

0 commit comments

Comments
 (0)