Skip to content

Commit

Permalink
Add docs for terraform import command
Browse files Browse the repository at this point in the history
  • Loading branch information
zzaakiirr committed Nov 19, 2024
1 parent ca901e0 commit 25b286d
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions docs/terraform/overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ Suppose that you have CPLN configurations in YAML format for a Rails application
│ ├── postgres.yml -- Workload config for PostgreSQL
│ └── rails.yml -- Workload config for Rails
└── controlplane.yml -- Configs for overall application
```

- **`controlplane.yml`**
```yaml
Expand Down Expand Up @@ -387,6 +388,20 @@ To deploy your application, follow these steps:
terraform apply
```

## Importing Existing Infrastructure

In addition to generating Terraform configurations, you can also import existing infrastructure into Terraform management using the `cpflow terraform import` command. This is useful when you have resources that were created outside of Terraform and you want to manage them using Terraform going forward.

### Usage

To import existing resources, run the following command:

```sh
cpflow terraform import
```

This command will import resources defined in your `controlplane.yml` and `templates` folder into the Terraform state.

## References

- [Terraform Provider Plugin](https://shakadocs.controlplane.com/terraform/installation#terraform-provider-plugin)
Expand Down

0 comments on commit 25b286d

Please sign in to comment.