A Terraform provider for the Square Connect V2 API (squareup.com)
Manage your Square POS catalog using Terraform:
terraform {
required_providers {
square = {
version = "0.0.1"
source = "jefflinse.io/com/square"
}
}
}
provider "square" {}
resource "square_catalog_category" "apparel" {
name = "Apparel"
}
resource "square_catalog_item" "tshirt" {
name = "T-shirt"
description = "Our regular t-shirt"
category_id = square_catalog_category.apparel.id
}
resource "square_catalog_item_variation" "xl" {
name = "Extra Large (XL)"
price = 3500
item_id = square_catalog_item.tshirt.id
}
To run locally:
- Clone this repo
- Run
make
to build and install the provider - Set
SQUARE_API_ACCESS_TOKEN
in your environment to your Square sandbox OAUTH access token. - Copy the example above into a Terraform configuration file
- Run
terraform init
- Run
terraform apply
to create the example resources
This projects is very much in its infancy. The feature set is limited to my own original needs, but I am actively developing this provider. Contributions are absolutely welcomed.
Supported Resources:
- CatalogCategory
- CatalogDiscount
- CatalogItemVariation
- CatalogItem
- CatalogTax