Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/andrewbaxter/terraform-provider-stripe
A Terrform provider for Stripe generated from the OpenAPI spec
https://github.com/andrewbaxter/terraform-provider-stripe
Last synced: about 23 hours ago
JSON representation
A Terrform provider for Stripe generated from the OpenAPI spec
- Host: GitHub
- URL: https://github.com/andrewbaxter/terraform-provider-stripe
- Owner: andrewbaxter
- License: isc
- Created: 2022-11-24T19:19:41.000Z (almost 2 years ago)
- Default Branch: master
- Last Pushed: 2024-09-12T15:49:32.000Z (2 months ago)
- Last Synced: 2024-09-13T04:31:22.379Z (2 months ago)
- Language: Go
- Size: 289 KB
- Stars: 1
- Watchers: 3
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
This is an unofficial Terraform provider for [Stripe](https://stripe.com/) automatically generated from their OpenAPI spec.
If you find any issues with it or it needs to be updated please let me know!
This is now (as of 2022-11-26) nominally working. If this works for you I'd also like to hear!
* [Terraform Registry](https://registry.terraform.io/providers/andrewbaxter/stripe)
# Installation with Terraform
See the dropdown on the Registry page.
# Installation with Terraform CDK
Run
```
cdktf provider add andrewbaxter/stripe
```# Documentation
See the Registry or look at `docs/`.
# Building
Make sure git submodules are cloned and up to date with `git submodule update --init`.
Run
```
./build.sh
```This will generate the source files and render the docs.
# Troubleshooting
You can see some info on the HTTP requests by setting environment variable
```
TF_LOG_PROVIDER=JSON
```before running Terraform.
# Technical details
Terraform spec challenges
1. Objects nested under objects aren't allowed. There's a workaround (`TfSource` and `TfDest`) implemented that abstracts around flattening child fields into the parent object. This is decently clean.
2. Objects can't be placed in arbitrary KV maps. The workaround here is a `FakeMap` which is an array with an extra `key` field which gets transformed into/from a map on the api side. This is decently clean.
3. No support for unions. This is partially worked around by provider-side validation, but it might not be perfect (some invalid configs may be let through - hopefully caught by the API itself).Stripe API challenges
1. Malformed objects, enums, enums with only one empty element, empty objects, etc.
2. Infinite reference loopsWorking around the Stripe issues ended up being very ugly, I'm hoping I can clean up the workarounds to at least make the code more readable at some point.