Terraform provider for Cloud Automator
- Terraform Website: https://terraform.io
- Cloud Automator: https://cloudautomator.com
- Cloud Automator API Document: https://api.cloudautomator.com
- Go 1.25 or later
- GNU Make
Clone the repository:
$ git clone [email protected]:CloudAutomator/terraform-provider-cloudautomator.git
$ cd terraform-provider-cloudautomator
Build the provider binary. The build writes terraform-provider-cloudautomator_v<VERSION>
into ./bin/
:
$ make build VERSION=<release-version>
Install the built binary into the Terraform plugin directory for your OS/architecture:
$ make install VERSION=<release-version>
The project uses a GNUmakefile
for common development tasks.
Run unit tests:
$ make test
Run acceptance tests (requires valid Cloud Automator API credentials):
$ make testacc
Format Terraform example files:
$ make fmt
Generate provider documentation from schema definitions:
$ make docs-generate
Verify documentation is up to date:
$ make test-docs
Remove installed provider binaries:
$ make clean VERSION=<release-version>
Cloud Automator Provider authentication settings are applied in the following order.
- Parameters in the provider configuration
- Environment variables
provider "cloudautomator" {
api_key = "abcdefghijklmnopqrstuvwxyz"
}
provider "cloudautomator" {}
$ export CLOUD_AUTOMATOR_API_KEY="abcdefghijklmnopqrstuvwxyz"
$ terraform plan
Cloud Automator Provider can be customized to connect to non-default endpoints and is applied in the following order.
- Parameters in the provider configuration
- Environment variables
provider "cloudautomator" {
...
api_endpoint = "http://localhost:3000/api/v1/"
}
provider "cloudautomator" {}
$ export CLOUD_AUTOMATOR_API_ENDPOINT="http://localhost:3000/api/v1/"
$ terraform plan
# Configure the Cloud Automator Provider
terraform {
required_providers {
cloudautomator = {
source = "CloudAutomator/cloudautomator"
version = "0.3.1"
}
}
}
provider "cloudautomator" {}
resource "cloudautomator_job" "example-job" {
name = "example-job"
group_id = 10
rule_type = "cron"
cron_rule_value {
hour = "9"
minutes = "30"
schedule_type = "weekly"
weekly_schedule = [
"monday",
"sunday"
]
time_zone = "Tokyo"
dates_to_skip = ["2022-12-31"]
national_holiday_schedule = "true"
}
action_type = "delay"
delay_action_value {
delay_minutes = 1
}
completed_post_process_id = [100]
failed_post_process_id = [200]
}
The provider ships with auto-generated documentation under docs/
. Run make docs-generate
after updating schemas to refresh the content.
For detailed usage examples of specific actions, see the examples/
directory which contains over 70 sample configurations for various Cloud Automator job actions.
cloudautomator_job
– Manage Cloud Automator jobs. Seedocs/resources/job.md
for the complete schema.cloudautomator_job_workflow
– Manage job workflows. Seedocs/resources/job_workflow.md
.cloudautomator_post_process
– Manage post-process definitions. Seedocs/resources/post_process.md
.
cloudautomator_job
– Retrieve job details. Seedocs/data-sources/job.md
.cloudautomator_job_workflow
– Retrieve job workflow details. Seedocs/data-sources/job_workflow.md
.cloudautomator_post_process
– Retrieve post-process definitions. Seedocs/data-sources/post_process.md
.cloudautomator_aws_account
– Retrieve Cloud Automator AWS account metadata. Seedocs/data-sources/aws_account.md
.