iagctl create service opentofu-plan
iagctl create service opentofu-plan
Create a new OpenTofu plan service.
The iagctl create service opentofu-plan command creates an OpenTofu plan service in the gateway data store. You can then run the service with the iagctl run command. For more information, see Create gateway services.
Consider an OpenTofu plan in a repository called example-repo with the following directory layout:
To create a service from the plan files in the deployment-plans directory, specify the repository with --repository and the subdirectory with --working-dir.
Prerequisites
Before you create an OpenTofu plan service, you need a repository that contains your plan files.
Syntax
Usage notes
Variables
Pass variables to the plan with the --var flag using key=value syntax. To reference a variables file in the repository, use --var-file. The file path must be relative to your --working-dir.
Decorators
You can attach a decorator to the service for input validation at runtime with the --decorator flag. For more information, see iagctl create decorator.
Examples
Create a basic OpenTofu plan service
The following example creates a service called my-opentofu-service where the plan files are at the root of the my-repo repository:
Create an OpenTofu plan service with all options
The following example creates a service that specifies a working directory, variables, a variable file, a decorator, and metadata: