This page describes how to generate and build an AWS SDK. Generating an SDK from source may be useful in testing fixes, learning how AWS SDKs work internally, or just experimentation.
This process is not necessary to use an AWS SDK, as one can simply depend on the artifacts available in Maven Central. See the getting started guide for details.
- Git
- Java JDK 1.8+
In this example we'll build the AWS DynamoDB SDK.
git clone https://github.com/aws/aws-sdk-kotlin.git
cd aws-sdk-kotlinGenerate the DynamoDB SDK:
./gradlew -Paws.services=+dynamodb :codegen:sdk:bootstrapNotice we specify the name of the service as dynamodb. The names for all AWS services can be found in
codegen/sdk/aws-models.
. So for example the name used for AWS CloudFormation's model cloudformation.2010-05-15.json
would be cloudformation. The date and json extension are removed.
./gradlew :services:dynamodb:buildOnce this completes a compiled SDK for the AWS DynamoDB service has been generated. The version will vary depending on whatever is the latest version in the repository.
ls services/dynamodb/build/libs
dynamodb-<version>.jarTo use this compiled SDK from another program locally, the local Maven repository can be used. The following command
will publish artifacts from aws-sdk-kotlin to the local maven repository, including the DynamoDB service and supporting
runtime libraries:
./gradlew publishToMavenLocalIn order to use an SDK published to the local maven repository, the mavenLocal() repository must be added to the program's
build file:
repositories {
mavenLocal()
}
And then simply add the dependency:
dependencies {
implementation("aws.sdk.kotlin:dynamodb:<version>")
}
This page covers building an AWS SDK using the aws-sdk-kotlin SDK generator. If you experience problems please file
an issue. If you have questions or ideas about how we can improve our
SDKs, please join our discussions.