Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Global owners for all files in the repository
* @levivannoort
37 changes: 37 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
---
name: Bug Report
about: Report a bug in the Appwrite Terraform provider
title: ""
labels: bug
assignees: ""
---

## Description

A clear and concise description of the bug.

## Terraform Configuration

```hcl
# Minimal Terraform configuration to reproduce the issue
```

## Expected Behavior

What you expected to happen.

## Actual Behavior

What actually happened. Include any error messages.

## Steps to Reproduce

1. Run `terraform plan` with the above configuration
2. ...

## Environment

- Terraform version: (output of `terraform version`)
- Provider version:
- Appwrite version: (Cloud or Community Edition version)
- OS:
25 changes: 25 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
---
name: Feature Request
about: Suggest a new resource, data source, or improvement
title: ""
labels: enhancement
assignees: ""
---

## Description

A clear and concise description of the feature you'd like.

## Use Case

Why is this feature needed? What problem does it solve?

## Proposed Configuration

```hcl
# Example of how the feature would be used in Terraform
```

## Additional Context

Any other context, links to Appwrite documentation, or screenshots.
19 changes: 19 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
## Description

Brief description of the changes.

## Type of Change

- [ ] Bug fix
- [ ] New resource or data source
- [ ] Enhancement to existing resource
- [ ] Documentation
- [ ] Other

## Checklist

- [ ] `make lint` passes
- [ ] `make test` passes
- [ ] `make docs` has been run and changes committed
- [ ] Acceptance tests added/updated (for resource changes)
- [ ] Examples added/updated (for new resources/data sources)
6 changes: 4 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,10 @@ jobs:
go-version-file: go.mod
cache: true

- name: Go vet
run: go vet ./...
- name: golangci-lint
run: |
go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest
golangci-lint run

- name: Check formatting
run: |
Expand Down
86 changes: 86 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
linters:
enable:
# Default linters
- errcheck
- gosimple
- govet
- ineffassign
- staticcheck
- unused

# Code style
- gofmt
- goimports
- misspell
- unconvert
- whitespace

# Bug detection
- bodyclose
- durationcheck
- nilerr
- noctx
- rowserrcheck
- sqlclosecheck
- wastedassign

# Code complexity & maintenance
- copyloopvar
- dupword
- errname
- errorlint
- fatcontext
- goconst
- goprintffuncname
- makezero
- nosprintfhostport
- prealloc
- predeclared
- reassign
- revive
- usetesting
- tparallel
- usestdlibvars

linters-settings:
errcheck:
check-type-assertions: true
goconst:
min-len: 3
min-occurrences: 3
misspell:
locale: US
revive:
rules:
- name: blank-imports
- name: context-as-argument
- name: context-keys-type
- name: dot-imports
- name: error-return
- name: error-strings
- name: error-naming
- name: exported
disabled: true
- name: increment-decrement
- name: var-naming
- name: range
- name: receiver-naming
- name: time-naming
- name: unexported-return
- name: indent-error-flow
- name: errorf
- name: empty-block
- name: superfluous-else
- name: unused-parameter
disabled: true
- name: unreachable-code
- name: redefines-builtin-id

issues:
exclude-dirs:
- vendor
max-issues-per-linter: 0
max-same-issues: 0

run:
timeout: 5m
71 changes: 71 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
# Changelog

All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]

### Added

- Data sources for storage buckets, users, teams, functions, sites, topics, and webhooks
- Schema validators for deployment `source_type`, bucket `compression`, and function `name`/`runtime`
- User-Agent header (`terraform-provider-appwrite/<version>`) on all API calls
- Acceptance tests for function and site deployment resources and data sources
- `CHANGELOG.md`, `CONTRIBUTING.md`, `SECURITY.md`, and GitHub issue templates
- `CODEOWNERS` file and pull request template
- `golangci-lint` in CI pipeline
- Import support for function and site deployment resources

## [1.2.1] - 2026-04-17

### Fixed

- Index creation resource handling
- Duplicate example files removed from the repository

## [1.2.0] - 2026-04-17

### Changed

- Upgraded `go-sdk` to `v3.0.0` with webhook field renames

## [1.1.0] - 2026-04-17

### Added

- Deployment resources for sites and functions
- Documentation and examples for deployment resources

## [1.0.2] - 2026-04-17

### Changed

- Polished repository README

### Fixed

- Added `WaitForColumnAvailable` preventing column creation errors
- Error handling for self-hosted API limitations

## [1.0.1] - 2026-04-13

### Changed

- Refactored documentation

## [1.0.0] - 2026-04-12

### Added

- Resources for functions and sites with their respective variables
- Cleaned up documentation

## [0.0.8] - 2026-04-12

### Added

- Initial release with support for TablesDB, Storage, Auth, Messaging, Webhooks, and Backup Policies
- Acceptance tests for all resources
- Auto-generated documentation via `terraform-plugin-docs`
87 changes: 87 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
# Contributing to Terraform Provider for Appwrite

Thank you for your interest in contributing! This document provides guidelines for contributing to the Appwrite Terraform provider.

## Development Setup

### Prerequisites

- [Go](https://golang.org/doc/install) (see `go.mod` for required version)
- [Terraform](https://www.terraform.io/downloads.html) >= 1.0
- An Appwrite instance (Cloud or Community Edition) for acceptance testing

### Building

```bash
make build
```

### Installing Locally

```bash
make install
```

This installs the provider to `~/.terraform.d/plugins/` for local testing.

### Running Tests

Unit tests:

```bash
make test
```

Acceptance tests (requires a running Appwrite instance):

```bash
export APPWRITE_ENDPOINT="https://cloud.appwrite.io/v1"
export APPWRITE_PROJECT_ID="your-project-id"
export APPWRITE_API_KEY="your-api-key"
make acceptance-test
```

### Linting

```bash
make lint
```

### Generating Documentation

```bash
make docs
```

Documentation is auto-generated from schema definitions and examples using [terraform-plugin-docs](https://github.com/hashicorp/terraform-plugin-docs). Always run `make docs` after changing resource schemas or examples.

## Adding a New Resource

1. Create a new directory under `internal/services/<service>/`
2. Implement `resource.go` with the Plugin Framework interfaces
3. Add the resource to `provider.go` in the `Resources()` method
4. Create an example in `examples/resources/appwrite_<resource_name>/resource.tf`
5. Create an import example in `examples/resources/appwrite_<resource_name>/import.sh`
6. Create a doc template in `templates/resources/<resource_name>.md.tmpl`
7. Write acceptance tests in `resource_test.go`
8. Run `make docs` to generate documentation

## Adding a New Data Source

Follow the same pattern as resources, but use `datasource.DataSource` interface and register in the `DataSources()` method.

## Pull Request Process

1. Fork the repository and create a feature branch
2. Write or update tests for your changes
3. Run `make lint` and `make test` to verify your changes
4. Run `make docs` and commit any generated documentation changes
5. Open a pull request with a clear description of the changes

## Code Style

- Follow standard Go conventions (`gofmt`, `go vet`)
- Use the Terraform Plugin Framework (not SDK v2) for new resources
- Keep resource implementations consistent with existing patterns
- Mark sensitive fields with `Sensitive: true`
- Handle 404 errors in Read by calling `resp.State.RemoveResource(ctx)`
24 changes: 24 additions & 0 deletions SECURITY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Security Policy

## Supported Versions

| Version | Supported |
| ------- | ------------------ |
| latest | :white_check_mark: |

## Reporting a Vulnerability

If you discover a security vulnerability in this Terraform provider, please report it responsibly.

**Do not open a public GitHub issue for security vulnerabilities.**

Instead, please report vulnerabilities to [security@appwrite.io](mailto:security@appwrite.io).

Include the following information:

- Description of the vulnerability
- Steps to reproduce
- Potential impact
- Suggested fix (if any)

We will acknowledge receipt within 48 hours and provide a detailed response within 7 days.
Loading
Loading