Skip to content

Instantly share code, notes, and snippets.

@Integralist
Created April 25, 2023 13:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Integralist/d8566501ff70f0f09f7262e440c02868 to your computer and use it in GitHub Desktop.
Save Integralist/d8566501ff70f0f09f7262e440c02868 to your computer and use it in GitHub Desktop.
[API Versioning Strategies] #api #versioning

Terraform Analysis

Terraform uses SDKs for interacting with provider APIs. There isn’t a distinction to be made for Terraform. You just bump the SDK version and it’s down to the individual provider APIs ‘under the covers’ to handle versioning. So in that case I looked at the top providers listed on https://registry.terraform.io/browse/providers which are AWS, Azure and Google Cloud Platform.

AWS

AWS versions its APIs using a versioning system based on the format “YYYY-MM-DD”. The YYYY-MM-DD format is based on the date of the API release. Each API has its own version number, which is incremented with each new release.

For example, an API released on January 1st, 2020, would have a version number of “2020-01-01”.

In the SDK you pass in the API version you want, for example…

var dynamodb = new AWS.DynamoDB({apiVersion: '2011-12-05'});

Reference

https://docs.aws.amazon.com/sdk-for-javascript/v2/developer-guide/locking-api-versions.html

Azure

To quote Microsoft…

To specify which version of an operation to use, set the api-version query parameter. The version is of the format Group.Major.Minor where Group is in the format ‘YYYY-MM-DD’ and Major is an integer and Minor is an integer.

For example…

?api-version=2020-09-01.12.0

Reference:

https://learn.microsoft.com/en-us/rest/api/batchservice/batch-service-rest-api-versioning

Google Cloud Platform

Google uses a path based versioning system. The beginning of the path contains the version and it’s only a major version. The Google documentation states…

Google APIs must not expose minor or patch version numbers. For example, Google APIs use v1, not v1.0, v1.1, or v1.4.2. From a user's perspective, major versions are updated in place, and users receive new functionality without migration.

Reference

https://cloud.google.com/apis/design/versioning

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment