Add support for coolify_application resource - #87
Open
FaureAlexis wants to merge 5 commits into
Open
FaureAlexis wants to merge 5 commits into
FaureAlexis wants to merge 5 commits into
Conversation
Add StringOrNil function that returns nil for null, unknown, or empty strings. This is useful for API fields that should be omitted when empty rather than sending empty strings.
Use StringOrNil instead of ValueStringPointer for DestinationUuid to prevent sending empty strings to the API when the field is not set.
The Coolify API only accepts key, value, is_preview, and is_literal during creation. Other fields (is_build_time, is_multiline, is_shown_once) must be updated via a bulk update after creation.
Implement coolify_application resource supporting multiple application types: - Public Git repositories - Private Git repositories with deploy keys - GitHub App deployments - Dockerfile-based deployments - Docker Image deployments - Docker Compose deployments Includes comprehensive model mapping, plan modifiers, unit tests, acceptance tests, and example Terraform configurations for each application type.
Author
|
Also fixed a bug with applications env : |
Add utility script for installing the provider locally for development and testing purposes.
Contributor
|
This is a very big PR. Its quite hard to review 2k changes. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🎯 Scope
Add full support for Coolify applications in the Terraform provider, enabling creation and management of applications via IaC.
Requested in #51
I have tested and deployed an infra with 7 differents applications(laravel, nodejs, nuxtjs) + 2 services (valkey, mysql) using theses changes.
✨ Features
6 supported source types:
public- Public Git repositoryprivate-github-app- Private Git repository via GitHub Appprivate-deploy-key- Private Git repository via Deploy Keydockerfile- Application with custom Dockerfiledockerimage- Docker image from a registrydockercompose- Docker Compose applicationFull CRUD operations: Create, Read, Update, Delete
Import: Import existing applications by UUID
Conditional validation: Required fields depend on
source_typeSensitive data management: Secrets are automatically marked as sensitive
📝 Usage example
📦 Added files
internal/service/application_model.go- Terraform model and schemainternal/service/application_resource.go- CRUD implementationinternal/service/application_resource_test.go- Unit testsinternal/service/application_resource_acceptance_test.go- Acceptance testsexamples/resources/coolify_application/*- Examples for each typeFEATURES_APPLICATION.md- Complete documentationUSAGE_LOCAL.md- Local usage guidescripts/install-local-provider.sh- Installation script (local testing)🔧 Modified files
tools/tfplugingen-openapi.yml- Configuration to generate the resourceinternal/provider/provider.go- Resource registration✅ Tests
📚 Documentation
examples/resources/coolify_application/🚀 How to test