# terraform-v2-cli-upgrade
Source: https://speakeasy.com/blog/terraform-v2-cli-upgrade


Following on from our TypeScript work in January, we've kept our focus on upleveling our developer experience of both our platform and our generation targets. This month our CLI got an overhaul, and Terraform got a package of upgrades. The result is an experience that is more intuitive, more powerful, and more flexible for both our users and their end users.

Let's jump into it 🚀

## Terraform v2

Terraform is the go to tool for businesses implementing a strict disaster recovery plan. For any SaaS businesses trying to sell API usage to these enterprises, that makes offering a Terraform Provider a must-have.

Our Terraform generation has made maintaining a provider trivially easy and unlocked our customers ability to win large enterprise contracts. We've been working hard to extend that opportunity to every API. That's why we're excited to announce the release of Terraform v2 with a range of new features to support increasingly complex APIs:

- Collapse multiple API endpoints into a single Terraform Entity.
- Add Custom Plan Validators to your Provider
- Automatically enforced Runtime Validations
- Support for `default` and `const` attributes
- Handling of Batch Endpoints

For the details, please read the full release notes [here](/post/release-terraform-v2).

## Upgraded CLI - Enhanced Quickstart

We received a lot of feedback from our users about the CLI being their preferred interface for generating SDKs. We've therefore invested in creating what we think is one of the best CLI experiences available anywhere today. The principles that guided our rebuild were:

- ✨ No magic incantations required
- 😀 Flattened command hierarchy
- 👩‍🔧 Design for humans

Tangibly it means you don't need any context or docs to use the CLI. Our interactive prompts will make setting up your SDKs a breeze.

<div className="mt-10">
  <video controls={false} loop={true} autoPlay={true} width="100%" muted={true}>
    <source src="/assets/videos/cli-quickstart.mp4" type="video/mp4" />
  </video>
</div>

If you're interested in learning how we built the new CLI, [the code is open source](https://github.com/speakeasy-api/speakeasy) and a detailed blog post is available [here](/post/how-we-built-cli).

## 🚢 Improvements and Bug Fixes 🐛

#### Most recent version: [Speakeasy v1.200.1](https://github.com/speakeasy-api/speakeasy/releases/tag/v1.200.1)

🚢 Generation of SSE usage examples in `Readme.md`\
🐛 Correct construction of input statements when readOnly: true\
🚢 use defaults for usage snippet rendering if example not available\
🚢 support disabling security for a single operation\
🐛 don't regenerate if no version bump detected\
🐛 handle nullable enums correctly\

### Typescript

🚢 Support for [Retry-After](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Retry-After) headers\
🚢 Support for URL based cursor based pagination\
🚢 Allow string enums to be used in SSE data\
🚢 Make const fields optional on the client\
🚢 Improve validation errors thrown from SDK methods\
🚢 Introduce new response format with http metadata\
🚢 Support SDKs that do not have global servers

### Java

🚢 Support for new Sonatype Central Publishing\
🚢 Support bigint, decimal format\
🚢 Retries support\
🐛 Handle non-numeric cursors for pagination\
🐛 Fixed imports and handling of security builder field names\
🐛 Pagination response constructor signature, internal whitespace/ordering

### Python

🐛 Invalid dataclasses if method has params both with and without default value

### Ruby

🐛 fix server param in docstring\
🐛 handle named servers\
🐛 improve security and parameter handling\
🐛 improve unmarshalling of complex data types\
🐛 change base64 encodingtechnique to support long credentials

### Terraform

🚢 Allow for arrays of non-string enums\
🚢 Support for custom plan validators

### C#

🚢 example generation for complex objects\
🚢 add support for nullable request bodies\
🚢 support .NET5 compilation checks\
🚢 extend BigInteger/Decimal support to arrays and maps\
🚢 add support for global security callbacks\
🐛 revert dotnet version default to 5.x

### Go

🚢 Allow string enums to be used in SSE data