AWS SDK Tutorial

Learn via video courses
Topics Covered

Overview

Developers are creating web or mobile applications on their local system or internal common-sharing setup. Once the application is ready, the application code will be pushed onto the servers and the website or application will become live. Here, servers are present either in the cloud or on-premise. If the server is in the cloud, developers have two options to make the application code live. They can do a lift and shift approach, which requires minimal or no changes in their application code, or develop a cloud-native application from scratch. AWS provides an AWS SDK for developers to develop cloud-native applications on AWS for almost 9 programming languages.

What is AWS SDK?

SDK-Software Development Kit

The SDK consists of a set of libraries with language-specific APIs.The AWS SDK enables developers to access and manage AWS services programmatically embedded with application code.

  • SDK- Javascript, Python, .NET, Ruby, Java, Go,Node.js, C++
  • Mobile SDKs - Android, IOS
  • IoT Device SDKs - Embedded C, Arduino

The AWS CLI, for example, is based on the AWS SDK for Python BOTO.

The AWS SDK is a common way of interacting with the API and services of AWS services. The SDK provides a language and idiomatic wrapper around the APIs so that we can interact with the services.

Since all of AWS's services are based on an API-driven architecture, developers can use an SDK of their own choice to interact with the AWS service.

Developer Tools for AWS

Developer tools help developers to build cloud-native applications on AWS or migrate their application code to the AWS cloud.

AWS CodeCommit

  • AWS CodeCommit is a version control system hosted by AWS.
  • AWS CodeCommit is a highly secure, scalable, and managed source control or version control service that enables developers to host private GIT repositories. Application code, documents, and binary files can be securely stored in AWS Codecommit
  • AWS CodeCommit lets us manage our version control system by providing developers with an environment or infrastructure where they can push the application code or pull the application code.
  • Developers can easily commit, branch, and merge their code based on the projects within the team. They can securely transfer files to and from AWS CodeCommit by using either the HTTPS or SSH protocol.
  • AWS CodeCommit is highly available because the repository is stored in Amazon S3 and Amazon DynamoDB services.
  • AWS CodeCommit supports all the GIT commands and works with the existing GIT tools available today.

The below diagram illustrates the codecommit working

codecommit working

Pricing of AWS CodeCommit

UsersCostRepositories per accountStorageGit Request per month
First 5 active users*$0.00Default-10000 repositories, Can be increased up to 2500050 GB per month2000 Git request per user
Each additional active user beyond the first 5*$1.00 per monthDefault-10000 repositories, Can be increased up to 2500010 GB per month2000 Git request per user

AWS CodePipeline

  • Every business in the IT industry works in a dynamic and demanding release of their application or software production/development/testing phase release.
  • AWS CodePipeline is a continuous delivery service for fast and reliable applications.
  • AWS CodePipeline helps streamline the process of software release.
  • Once code is merged with a master branch or any changes in the source repo in CodeCommit or a third-party repo such as GitHub or BitBucket, then the codes are automatically built, tested, and deployed to the destined infrastructure such as EC2 or ECS, etc.
  • In the event of bugs, new feature updates, or prone-to-error in the code, CodePipeline will automatically roll back to the earlier software version. Thus, achieving high availability can be maintained.

Pricing of AWS CodePipeline

One Active CodePipeline cost one dollar per month irrespective of all-region

AWS CodeBuild

  • AWS CodeBuild is a managed continuous integration service. 
  • AWS CodeBuild will compile the source code of our application and run a test that later produces software or code packages that will be used to deploy the application to the compute resources.
  • Developers can choose from the existing prepackaged build environments or create their build environments that use their existing build tools such as Jenkins.
  • CodeBuild helps to identify and fix errors quickly in the testing and development phases of the software or application life cycle. 
  • Customers only pay for the time spent building.

aws codebuild working

Pricing of AWS CodeBuild

EC2 Instance typeRAMVcpuLinux price per build minutewindows price per build minute
arm1.small3 GB2$0.002N/A
general1.small3 GB2$0.005N/A
general1.medium7 GB4$0.01N/A
arm1.large16 GiB8$0.015N/A
general1.large15 GB8$0.02N/A
general1.2xlarge144 GiB72$0.20N/A

The above pricing is based on the Mumbai region

AWS CodeDeploy

  • AWS CodeDeploy is the continuous deployment service in the lifecycle of the CI/CD pipeline.
  • It helps the automation process of the deployment of software and applications to computing resources such as AWS EC2, AWS Fargate, AWS Lambda, and servers residing on-premise as well.
  • By utilizing CodeDeploy, customers can eliminate the need for error-prone manual operations and maximize application availability. Components of sample CodeDeploy Configuration files
  • The code deployment configuration file should be included in the revision by developers. The configuration file is called a YAML file or AppSpec File.

FILE

  • The file section specifies what files and folders go to what destination on each instance in the deployment group

HOOKS

  • The hooks section specifies the location of the script to run during each phase of the deployment
  • The phases are also called lifecycle events

appspec file

Pricing on AWS CodeDeploy

  • CodeDeploy on AWS 
    • There is no additional charge that will be incurred for using codeDeploy in computer resources such as Amazon EC2, lambda, ECS, etc.
  • CodeDeploy on On-premise
    • If the servers are on-premise, customers will pay $0.02 per on-premises instance.

Various SDKs

AWS provides lots of plugins to integrate with the IDE (Integrated Development Environment), along with some native developer tools as well. So developers can easily configure and start building an application on AWS by using it without hassle.

The below mention diagram illustrates the lifecycle followed by AWS for all the AWS SDKs version releases.

lifecycle followed by aws

AWS Java SDK

  • Java is a high-level programming language that is both robust and object-oriented. It was developed by Sun Microsystems.
  • The AWS SDK for Java provides libraries that are simple to use and get familiar with.
  • It helps Java developers integrate with AWS services easily from their Java applications.
  • The latest version of AWS SDK for Java provides features such as nonblocking I/O and automatic pagination.

Key features and support provided by the AWS JAVA SDK

Supports True Non-Blocking I/O, Automatic Pagination, and HTTPS/2 plugins API lifecycle-Data marshaling, serialization, credential management, and retries.

Tools available for Java on AWS

  1. AWS Toolkit for IntelliJ
  2. AWS ToolKit for Visual Studio Code
  3. AWS Toolkit for Eclipse
  4. Amazon Correto OpenJDK
  5. AWS Cloud Development Kit in Java

AWS .NET SDK

  • .NET is an open-source framework developed by Microsoft that is used to build web, mobile, desktop, gaming, and IoT applications.
  • The .NET SDK on AWS is an open-source set of libraries that abstract the working mechanisms of AWS services.
  • In layman's terms, this library can be used by .Net developers to interact with AWS Services from their .Net applications.
  • Cross-platform compatibility with the .Net framework, .Netcore, .Net 5, and Xamarin development kit is supported by the AWS SDK for .NET
  • AWS also provides various extensions to integrate with the .NET SDK for higher-level functionality.
  • AWS recommends that developers configure TLS version 1.2 or later when their .Net application communicates with AWS Services for security practices.
  • The below-mentioned tools are natively available in AWS to support applications built on the AWS Javascript SDK.
    • AWS Toolkit for Rider
    • AWS Toolkit for Visual Studio
    • AWS Toolkit for Visual Studio Code
    • AWS Tool for PowerShell
    • AWS Tools for Azure DevOps

Key features and support provided by the AWS .NET SDK

API LIFECYCLE-Retries, data marshaling, serialization, and credential management Abstraction-Cognito Identity Provider, AWS DynamoDB Session State provider, and S3 Transfer Utility

AWS Node.js SDK

  • Javascript is one of the most popular programming languages used by developers worldwide.
  • Javascript enables developers to build web, mobile, and desktop applications with the help of NodeJS.
  • The AWS SDK for Javascript is an open-source set of libraries that are familiar to Javascript developers. It also provides a higher level of abstraction.
  • It provides support for three types of runtimes. They are NodeJS for servers, Javascript for browsers, and React Native for mobile development
  • It also provides support for cross-runtime as well.
  • The npm packages are published separately for each AWS service following the modular architecture of the Javascript SDK.
  • The below-mentioned tools are natively available to develop based on the aws javascript SDK. 
    • AWS Toolkit for Visual Studio Code
    • AWS Toolkit for WebStorm
    • AWS Cloud9 
    • AWS Amplify

Key features and support provided by the AWS NodeJS SDK

  • First-class TypeScript support- Compatible with ES5, ES6, and ES7.
  • API Lifecycle -retries, data marshaling, serialization, credential management, and deserialization.

AWS PHP SDK

  • PHP is a scripting language that is primarily used in web development. 
  • The AWS SDK for PHP, like other AWS SDKs, is a modern and open-source library.
  • The AWS SDK for PHP helps enable PHP developers to integrate their PHP applications with AWS services such as Amazon DynamoDB, Amazon S3, etc.
  • The latest version of the AWS SDK for PHP is version 3.
  • The latest version complies with PSR-4 and PSR-7 standards and has some other features to provide performance improvement and customer feedback.

Key features and support provided by the AWS PHP SDK

Supports-AWS Laravel SDK plugin

Features

  • Asynchronous requests
  • Streamlined extension architecture
  • JMESPath is a JSON querying language.
  • Response paginators
  • Command pools
  • Amazon DynamoDB JSON and Array Marshaler.
  • Amazon DynamoDB Session Handler
  • Amazon S3 Stream Wrapper
  • Waiters

AWS Python SDK

  • Python is a high-level programming language that supports a variety of programming paradigms.
  • It is used by developers to create web applications, automation scripts, ML models, data analysis and visualization, and so on.
  • Amazon named the AWS SDK for Python BOTO3.
  • Boto3 is open source. However, it requires Python 2.7+ or 3.4+ to be downloaded into the system.
  • Boto3 provides two distinct API levels. They are Client API and Resource API.
  • The AWS CLI is built with the AWS Python SDK.
  • AWS Cloud9 also supports developing applications using the AWS SDK for Python.
  • The AWS SDK for Python supports the below-mentioned features.
    • Credentials
    • Low-level clients
    • Resources
    • Session
    • Collections
    • Paginators
    • Error handling
    • Retries

AWS RUBY SDK

  • Ruby on Rails is a popular server-side framework for creating web application backends.
  • By providing Ruby classes, the latest version of the AWS Ruby SDK eliminates code complexity for almost every AWS service.
  • The AWS SDK for Ruby is available from RubyGems
  • Here, AWS service-specific gems are provided. So the developer can include the gems as per their AWS service usage and requirements.
  • The latest version of the AWS Ruby SDK is version 3.
  • Using the AWS Ruby SDK, AWS Cloud9, an IDE (Integrated development environment), can be used to develop scalable Ruby on Rails applications natively in the cloud.
  • Some other gems are relevant to Ruby developers. They are mentioned below.
    • Aws-SDK-rails: integrations for the AWS Ruby SDK.
    • AWS-Record: Provides data mapping abstraction for the Amazon DynamoDB service.

Conclusion

  • For the developer tools such as Codebuild and CodeCommit, the data in transit and the rest are encrypted. The encrypted data is redundantly stored across availability zones.
  • The developer tools are highly available and scalable. so the customer can focus on their development phase without worrying about managing the infrastructure for the source code system or version control system.
  • AWS SDK provides stable support for various programming languages, such as Python, Javascript, Ruby on Rails, C++, etc., as well.
  • All the AWS SDKs provided by AWS are open-source and free to use.
  • Customers can focus on building cloud-native applications for better scalability and performance rather than depending on traditional developer tools and monolithic applications.