-
Notifications
You must be signed in to change notification settings - Fork 50
Cloud Terraform provider beta #607
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
97 changes: 97 additions & 0 deletions
97
modules/deploy/pages/deployment-option/cloud/terraform-provider.adoc
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,97 @@ | ||
| = Redpanda Terraform Provider | ||
| :description: Learn how to use the Redpanda Terraform provider to create and manage resources in Redpanda Cloud. | ||
| :page-cloud: true | ||
| :page-beta: true | ||
|
|
||
| The https://registry.terraform.io/providers/redpanda-data/redpanda/latest[Redpanda Terraform provider^] interfaces with the Cloud API, so you can define your Redpanda infrastructure in Terraform configuration files. You can use the Terraform provider to create and manage the following resources in Redpanda Cloud: | ||
|
|
||
| * ACLs | ||
| * Clusters | ||
| * Networks | ||
| * Resource groups | ||
| * Topics | ||
| * Users | ||
|
|
||
| == Prerequisites | ||
|
|
||
| Install Terraform following the https://learn.hashicorp.com/tutorials/terraform/install-cli[Terraform documentation^]. | ||
|
|
||
| == Limitations | ||
|
|
||
| *?? TO REVIEWERS: Can you please confirm that the provider is supported on Serverless and Azure? And what functionality is supported in Cloud API but not provider, like Connectors?* | ||
|
|
||
| == Use the provider | ||
|
|
||
| . To install the Redpanda provider, copy and paste the following code into your Terraform configuration file: | ||
| + | ||
| ``` | ||
| terraform { | ||
| required_providers { | ||
| redpanda = { | ||
| source = "redpanda-data/redpanda" | ||
| version = "~> 0.5.1" | ||
| } | ||
| } | ||
| } | ||
| ``` | ||
|
|
||
| . Initialize Terraform: | ||
| + | ||
| ``` | ||
| terraform init | ||
| ``` | ||
|
|
||
| . For the provider to authenticate against Redpanda Cloud, enter your `client_id` and `client_secret` credentials in your Terraform configuration file or set them as environment variables: | ||
| + | ||
| [tabs] | ||
| ====== | ||
| Static credentials:: | ||
| + | ||
| -- | ||
|
|
||
| ``` | ||
| provider "redpanda" { | ||
| client_id = "<client_id>" | ||
| client_secret = "<client_secret>" | ||
| } | ||
| ``` | ||
|
|
||
| -- | ||
| Environment variables:: | ||
| + | ||
| -- | ||
|
|
||
| ``` | ||
| REDPANDA_CLIENT_ID=<client_id> | ||
| REDPANDA_CLIENT_SECRET=<client_secret> | ||
| ``` | ||
|
|
||
| -- | ||
| ====== | ||
|
|
||
| . For sample configurations, see the https://registry.terraform.io/providers/redpanda-data/redpanda/latest/docs[Redpanda Terraform provider docs^]. *NOTE TO REVIEWERS: This linked doc needs update for beta* | ||
|
|
||
| === Use the provider to create a new cluster | ||
|
|
||
| For an example of how to use the provider to create a new cluster, see https://github.com/redpanda-data/terraform-provider-redpanda/blob/main/examples/cluster/aws/main.tf[this example^]. | ||
|
|
||
| === Use the provider to manage an existing cluster | ||
|
|
||
| To manage resources in existing Redpanda Cloud clusters, you must reference the existing cluster using the cluster ID (Redpanda ID). The following example creates a topic in a cluster with ID `foo-bar-baz`. The `redpanda_topic` resource contains a field `cluster_api_url` that references the `data.redpanda_cluster.test.cluster_api_url` data resource. | ||
|
|
||
| ``` | ||
| data "redpanda_cluster" "test" { | ||
| id = "foo-bar-baz" | ||
| } | ||
|
|
||
| resource "redpanda_topic" "test" { | ||
| name = "myTopicName" | ||
| partition_count = 3 | ||
| replication_factor = 3 | ||
| cluster_api_url = data.redpanda_cluster.test.cluster_api_url | ||
| } | ||
| ``` | ||
|
|
||
| === Additional examples | ||
|
|
||
| To see more ways to use the provider, see the https://github.com/redpanda-data/terraform-provider-redpanda/tree/main/examples[Redpanda Terraform provider examples^]. | ||
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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Serverless was recently added, Azure should also be supported if the Cloud API supports it. I will leave the final call to @gene-redpanda since he worked on a PR to bring feature parity between Cloud API and the TF provider
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Serverless yes, Azure I did not see in the product doc. I'll see if we can get that in there too.