Skip to content

Commit

Permalink
More docs
Browse files Browse the repository at this point in the history
Signed-off-by: AbstractionFactory <[email protected]>
  • Loading branch information
abstractionfactory committed Sep 9, 2024
1 parent 9540eb4 commit 6630034
Show file tree
Hide file tree
Showing 25 changed files with 202 additions and 81 deletions.
38 changes: 31 additions & 7 deletions frontend/docs/index.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,33 @@
---
title: The OpenTofu Registry
sidebar_title: Overview
sidebar_position: 1
---

# The OpenTofu Registry

The OpenTofu Registry provides an API for OpenTofu to locate providers and modules. This documentation will guide you through the most important steps in using the registry or publishing your modules and providers. Please select the topic you are interested in from the left sidebar.
The OpenTofu Registry provides an API for OpenTofu to locate providers and modules. This documentation will guide you through the most important steps in using the registry or publishing your modules and providers.

## For users

This section contains the documentation for OpenTofu users.

- [Overview](users)
- [Using a provider](users/providers)
- [Using a module](users/modules)
- [Security](users/security)

## For provider authors

This section guides you through the steps of creating and publishing an OpenTofu provider.

- [Overview](providers)
- [Creating a provider](providers/creating)
- [Publishing your provider](providers/publishing)
- [Adding GPG signatures](providers/gpg)
- [Writing docs for your provider](providers/docs)
- [Adding a provider to the registry](providers/adding)

## For module authors

This section shows you how to create and publish a module.

- [Overview](modules)
- [Creating a module](modules/creating)
- [Publishing a module](modules/publishing)
- [Adding a module to the OpenTofu Registry](modules/adding)

6 changes: 0 additions & 6 deletions frontend/docs/module-authors/adding.md

This file was deleted.

6 changes: 0 additions & 6 deletions frontend/docs/module-authors/creating.md

This file was deleted.

5 changes: 0 additions & 5 deletions frontend/docs/module-authors/index.md

This file was deleted.

6 changes: 0 additions & 6 deletions frontend/docs/module-authors/publishing.md

This file was deleted.

1 change: 1 addition & 0 deletions frontend/docs/modules/adding.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Adding your module to the OpenTofu registry
1 change: 1 addition & 0 deletions frontend/docs/modules/creating.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Creating an OpenTofu module
7 changes: 7 additions & 0 deletions frontend/docs/modules/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# The OpenTofu Registry for Module Authors

This section shows you how to create and publish a module.

- [Creating a module](modules/creating)
- [Publishing a module](modules/publishing)
- [Adding a module to the OpenTofu Registry](modules/adding)
1 change: 1 addition & 0 deletions frontend/docs/modules/publishing.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Publishing an OpenTofu module
6 changes: 0 additions & 6 deletions frontend/docs/provider-authors/adding.md

This file was deleted.

6 changes: 0 additions & 6 deletions frontend/docs/provider-authors/artifacts.md

This file was deleted.

6 changes: 0 additions & 6 deletions frontend/docs/provider-authors/creating.md

This file was deleted.

6 changes: 0 additions & 6 deletions frontend/docs/provider-authors/gpg.md

This file was deleted.

5 changes: 0 additions & 5 deletions frontend/docs/provider-authors/index.md

This file was deleted.

1 change: 1 addition & 0 deletions frontend/docs/providers/adding.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Adding your provider to the OpenTofu Registry
1 change: 1 addition & 0 deletions frontend/docs/providers/creating.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Creating an OpenTofu provider
1 change: 1 addition & 0 deletions frontend/docs/providers/docs.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Writing documentation for your provider
1 change: 1 addition & 0 deletions frontend/docs/providers/gpg.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Adding GPG signatures for your release
11 changes: 11 additions & 0 deletions frontend/docs/providers/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# The OpenTofu Registry for Provider Authors

This section of the documentation guides you through the basic steps of creating and publishing a provider in the OpenTofu Registry. The documentation assumes you are familiar with the Go programming language.

## In this section

- [Creating a provider](providers/creating)
- [Publishing your provider](providers/publishing)
- [Adding GPG signatures](providers/gpg)
- [Writing docs for your provider](providers/docs)
- [Adding a provider to the registry](providers/adding)
1 change: 1 addition & 0 deletions frontend/docs/providers/publishing.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Publishing a provider version
74 changes: 72 additions & 2 deletions frontend/docs/sidebar.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,87 @@
"slug": ""
},
{
"title": "Users",
"title": "For users",
"items": [
{
"title": "For user",
"title": "Overview",
"path": "users/index.md",
"slug": "users"
},
{
"title": "Using a provider",
"path": "users/providers.md",
"slug": "users/providers"
},
{
"title": "Using a module",
"path": "users/modules.md",
"slug": "users/modules"
},
{
"title": "Security",
"path": "users/security.md",
"slug": "users/security"
}
]
},
{
"title": "For provider authors",
"items": [
{
"title": "Overview",
"path": "providers/index.md",
"slug": "providers"
},
{
"title": "Creating a provider",
"path": "providers/creating.md",
"slug": "providers/creating"
},
{
"title": "Publishing your provider",
"path": "providers/publishing.md",
"slug": "providers/publishing"
},
{
"title": "Adding GPG signatures",
"path": "providers/gpg.md",
"slug": "providers/gpg"
},
{
"title": "Writing docs for your provider",
"path": "providers/docs.md",
"slug": "providers/docs"
},
{
"title": "Adding a provider to the registry",
"path": "providers/adding.md",
"slug": "providers/adding"
}
]
},
{
"title": "For module authors",
"items": [
{
"title": "Overview",
"path": "modules/index.md",
"slug": "modules"
},
{
"title": "Creating a module",
"path": "modules/creating.md",
"slug": "modules/creating"
},
{
"title": "Publishing a module",
"path": "modules/publishing.md",
"slug": "modules/publishing"
},
{
"title": "Adding a module to the OpenTofu Registry",
"path": "modules/adding.md",
"slug": "modules/adding"
}
]
}
Expand Down
14 changes: 9 additions & 5 deletions frontend/docs/users/index.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
---
title: The OpenTofu Registry for Users
sidebar_title: For user
sidebar_position: 100
---
# The OpenTofu Registry for Users

OpenTofu is but a tool that works with integrations made by the community called *providers*. In addition to that, community-made modules simplify many common tasks. The OpenTofu Registry contains an index pointing to thousands of providers and tends of thousands of modules on GitHub you can use. You can install them automatically by adding a code snippet to your project and running `tofu init`.

## In this chapter

- [Using a provider](users/providers)
- [Using a module](users/modules)
- [Security](users/security)
14 changes: 9 additions & 5 deletions frontend/docs/users/modules.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
---
title: Using a module
sidebar_title: Using a module
sidebar_position: 102
---
# Using a module

Modules provide reusable pieces of code for your OpenTofu project. The OpenTofu Registry contains references to over 20.000 modules on GitHub created by the community. You can [find a module for your use case using the OpenTofu Registry Search](https://search.opentofu.org/modules/). You can learn more about how modules work in OpenTofu from the [OpenTofu documentation](https://opentofu.org/docs/language/modules/).

~> The OpenTofu Registry does not perform security scanning on modules, and they may contain malicious code. Inspect any module you intend to use and only use modules from authors you trust.

## Integrating a module in your project

Module addresses have three parts: namespaces, names, and target systems. For example, the
59 changes: 54 additions & 5 deletions frontend/docs/users/providers.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,54 @@
---
title: Using a provider
sidebar_title: Using a provider
sidebar_position: 101
---
# Using a provider

Providers give OpenTofu the ability to call various APIs. The OpenTofu registry currently holds over 4000 such providers created by the community. They provide integrations for a vast range of services, from cloud providers, such as [AWS](https://search.opentofu.org/provider/hashicorp/aws/latest), [Azure](https://search.opentofu.org/provider/hashicorp/azurerm/latest), [GCP](https://search.opentofu.org/provider/hashicorp/google/latest) and more, version control systems, such as [GitHub](https://search.opentofu.org/provider/integrations/github/latest), [Gitlab](https://search.opentofu.org/provider/gitlabhq/gitlab/latest), to password manages like [1Password](https://search.opentofu.org/provider/1password/onepassword/latest). You can explore the providers available [using the OpenTofu Registry Search](https://search.opentofu.org/providers/) or learn more about how providers work in OpenTofu using the [OpenTofu documentation](https://opentofu.org/docs/language/providers/).

~> Providers are binary programs created by their authors that run on your machine. The OpenTofu Registry does not perform security scanning on providers, and they may contain malicious code. There is also no guarantee that the provider binary was compiled from the code in the linked GitHub repository. Only use providers from authors you trust.

## Integrating a provider into your project

Once you found a provider for your needs, you can add it to your OpenTofu project in the `terraform` block:

```hcl2
terraform {
required_providers {
PROVIDER_NAME_HERE = {
source = "NAMESPACE_HERE/PROVIDER_NAME_HERE"
version = "PROVIDER_VERSION_HERE"
}
}
}
```

You can then configure your provider as follows:

```hcl2
provider "PROVIDER_NAME_HERE" {
option1 = "value1"
option2 = "value2"
}
```

For example, you can configure and use the GitHub provider like this:

```hcl2
terraform {
required_providers {
integrations = {
source = "integrations/github"
version = "v6.2.3"
}
}
}
variable "github_token {}
provider "github" {
token = var.github_token
}
resource "github_repository" "myrepo" {
name = "myrepo"
}
```

-> Provider namespaces and names in the OpenTofu registry translate directly to GitHub URLs in the form of `github.com/NAMESPACE/terraform-provider-NAME`.
6 changes: 1 addition & 5 deletions frontend/docs/users/security.md
Original file line number Diff line number Diff line change
@@ -1,5 +1 @@
---
title: Security in the OpenTofu Registry
sidebar_title: Security
sidebar_position: 103
---
# Security in the OpenTofu Registry

0 comments on commit 6630034

Please sign in to comment.