terraform-provider-openfga

command module
v0.0.1-alpha.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 6, 2024 License: MIT Imports: 1 Imported by: 0

README

Terraform Provider OpenFGA

Go Report Card Taylor Swift

This provider is still in development and should not be used in production environments.

Example

terraform {
  required_providers {
    openfga = {
      source = "zeiss/openfga"
    }
  }
}

provider "openfga" {
  api_url = "http://host.docker.internal:8080"
}

resource "openfga_store" "demo" {
  name = "demo"
}

resource "openfga_model" "demo" {
  spec = "{\"schema_version\":\"1.1\",\"type_definitions\":[{\"type\":\"user\"},{\"type\":\"document\",\"relations\":{\"reader\":{\"this\":{}},\"writer\":{\"this\":{}},\"owner\":{\"this\":{}}},\"metadata\":{\"relations\":{\"reader\":{\"directly_related_user_types\":[{\"type\":\"user\"}]},\"writer\":{\"directly_related_user_types\":[{\"type\":\"user\"}]},\"owner\":{\"directly_related_user_types\":[{\"type\":\"user\"}]}}}}]}"
  store = {
    id = openfga_store.demo.id
  }
}

resource "openfga_tuple" "demo" {
  user     = "user:demo"
  relation = "reader"
  document = "document:demo"

  store = {
    id    = openfga_store.demo.id
    model = openfga_model.demo.id
  }
}

Resources

  • openfga_store
  • openfga_model
  • openfga_tuple

Development

Run the following command to build the provider

sh ./scripts/setupDev.sh

License

MIT

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
internal
cfg

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL