This repository is built on the template provided by: Terraform Plugin Framework. The template repository built on the Terraform Plugin SDK can be found at terraform-provider-scaffolding.
This repository is a terraform provider for Adyen, containing:
- A resources and a data sources can be found in (
internal/provider/
), - Examples can be found in (
examples/
) and generated documentation in (docs/
), - To generate or update documentation from root, run
go generate ./...
.
- Webhooks:
- Webhook Merchant
- Webhook Company
- Users
- Users Merchant
- Users Company
- API Credentials
- My API Credentials
- Company API Credentials
- Merchant API Credentials
- Terminal
- Actions
- Settings
- Orders
- Account:
- Account Merchant
- Account Company
- Account Store
- Payment Methods
- Payout Settings
- Allowed Origins
First, clone the terraform-provider-adyen
repository:
-
Open your terminal or command prompt.
-
Run the following command to clone the repository:
git clone https://github.com/weavedev/terraform-provider-adyen.git
-
Navigate to the cloned directory:
cd terraform-provider-adyen
- Go to Adyen and follow the instructions there to create a "test account" so you can get granted access to the "Test Customer Area".
- Go to your Test Customer Area and login with your credentials.
- Go to "Developers" -> "API credentials" -> "Create new credential".
- Create API Credential as a "Web service user".
- (Optional) Add a description to your API Credential.
- Note/Copy your API key under "Authentication" and optionally edit scopes under "Permissions" --> "Roles".
- Note your "Merchant" & "Company" accounts at the top left of your Dashboard.
terraform {
required_providers {
adyen = {
version = ">= 0.0.1"
source = "weavedev/adyen"
}
}
}
provider "adyen" {
api_key = "<api_key>" // From Step 6
environment = "<environment>" // Or "live"
merchant_account = "<merchant_account>" // From Step 7
company_account = "<company_account>" // From Step 7
}
# Example resource
resource "adyen_webhooks_merchant" "example_webhook" {
webhooks_merchant = {
type = "standard"
url = "https://webhook.site/etc-etc-etc"
username = "YOUR_USER"
password = "YOUR_PASSWORD"
active = false
communication_format = "json"
accepts_expired_certificate = false
accepts_self_signed_certificate = true
accepts_untrusted_root_certificate = true
populate_soap_action_header = false
}
}
-
Find
GOBIN
path. Your path may vary depending on how your Go environment variables are configured:go env GOBIN
If your
GOBIN
go environment variable is not set use the default path:/Users/<Username>/go/bin
-
Create a
.terraformrc
file in your home directory (~
), if necessary, then add thedev_overrides
block below. Change the<GOBIN_PATH>
to the value returned from the previous command:go env GOBIN
. Note: This override ensures that while developing you are using your locally compiled provider.provider_installation { dev_overrides { "registry.terraform.io/weavedev/adyen" = "<GOBIN_PATH>" } direct {} }
-
You should be getting this "Warning" from Terraform after adding your
dev_overrides
to the.terraformrc
file:Warning: Provider development overrides are in effect The following provider development overrides are set in the CLI configuration: - weavedev/adyen in /Users/tolgaakyazi/go/bin The behavior may therefore not match any released version of the provider and applying changes may cause the state to become incompatible with published releases.
-
Now you are ready to locally develop and test new data-sources, resources or functions for this provider!
After setting up your local provider install, you can start contributing to the provider.
-
You should, at this point, have a folder called
terraform-provider-adyen
,cd
into that folder and create a new branchcd terraform-provider-adyen git checkout -b feat/<your-feature-name>
-
Make the necessary changes to the codebase. Be sure to follow the project's coding standards and best practices.
-
Add your changes to a new commit
git add .
-
Commit the staged changes with a descriptive message
git commit -m 'Clear description of your changes/additions'
-
Push your changes to the repository
git push origin feat/<your-feature-name>
-
Finally, navigate to the repository on GitHub and open a pull request from your new branch. Provide a clear description of your changes and any relevant context.
- Your pull request will be reviewed by one of the maintainers.
- You might be asked to make additional changes.
- Once the changes are approved, the build & tests pass, your pull request will be merged.
- Keep your changes focused and concise.
- Ensure your code follows the project's style guidelines.
- Generate documentation as needed (
go generate ./...
). - Write acceptance tests for any new functionality (see:
webhook_merchant_resource_test.go
). Without tests, your PR will not be approved.
To create a release for your provider, follow these steps. The GitHub Action will trigger and create a release whenever a new valid version tag is pushed to the repository. Ensure your Terraform provider versions follow the Semantic Versioning standard (vMAJOR.MINOR.PATCH).
- Stage your changes
Add your changes to a new commit:git add .
- Commit your changes
Commit the staged changes with a descriptive message:
git commit -m 'Add docs, goreleaser, and GH actions'
- Create a new tag
Create a new tag following the Semantic Versioning standard (e.g.
v0.0.1
):git tag v0.0.1
- Push the tag to GitHub
Push the new tag to GitHub to trigger the release action:
Once the tag is pushed, GitHub Actions will automatically trigger the workflow to create a new release for your provider.
git push origin v0.0.1