Skip to content

Commit

Permalink
Add documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
valentindeaconu committed Jun 15, 2022
1 parent f45e5fa commit fc6d0c9
Show file tree
Hide file tree
Showing 7 changed files with 336 additions and 0 deletions.
29 changes: 29 additions & 0 deletions docs/data-sources/context.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "circleci_context Data Source - terraform-provider-circleci"
subcategory: ""
description: |-
---

# circleci_context (Data Source)

## Usage
```hcl
data "circleci_context" "my_context" {
name = "my-context"
}
```

<!-- schema generated by tfplugindocs -->
## Schema

### Required

- `name` (String) The name of the context

### Read-Only

- `id` (String) The ID of this resource.


31 changes: 31 additions & 0 deletions docs/data-sources/project.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "circleci_project Data Source - terraform-provider-circleci"
subcategory: ""
description: |-
---

# circleci_project (Data Source)

## Usage
```hcl
data "circleci_project" "my_project" {
name = "my-project"
}
```



<!-- schema generated by tfplugindocs -->
## Schema

### Required

- `name` (String) The name of the project

### Read-Only

- `id` (String) The ID of this resource.


42 changes: 42 additions & 0 deletions docs/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "circleci Provider"
subcategory: ""
description: |-
---

# circleci Provider

~> This provider uses Circle CI API v2.

## Usage
```hcl
terraform {
required_providers {
circleci = {
source = "SectorLabs/circleci"
}
}
}
provider "circleci" {
api_token = "YOUR_CIRCLECI_API_TOKEN"
vcs_type = "github"
organization = "MyOrganization"
}
```


<!-- schema generated by tfplugindocs -->
## Schema

### Required

- `organization` (String) The Circle CI organization.

### Optional

- `api_token` (String) The token key for API operations. Can also be set via `CIRCLECI_TOKEN` environment variable.
- `url` (String) The URL of the Circle CI API (v2).
- `vcs_type` (String) The VCS type for the organization.
55 changes: 55 additions & 0 deletions docs/resources/checkout_key.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "circleci_checkout_key Resource - terraform-provider-circleci"
subcategory: ""
description: |-
---

# circleci_checkout_key (Resource)

## Usage

Creating a `deploy-key`:
```hcl
resource "circleci_checkout_key" "my_deploy_key" {
project = "my_project"
type = "deploy-key"
}
```

Creating a `user-key`:
```hcl
resource "circleci_checkout_key" "my_user_key" {
project = data.circleci_project.my_project.name
type = "user-key"
}
```


<!-- schema generated by tfplugindocs -->
## Schema

### Required

- `project` (String) The name of the CircleCI project to create the checkout key in.
- `type` (String) The type of the checkout key. Can be either `user-key` or `deploy-key`.

### Read-Only

- `created_at` (String) The date and time the checkout key was created.
- `fingerprint` (String) The fingerprint of the checkout key.
- `id` (String) The ID of this resource.
- `preferred` (Boolean) A boolean value that indicates if this key is preferred.
- `public_key` (String) The public SSH key of the checkout key.

~> The `preferred` flag is automatically set to true on the most recent key created.

~> For `deploy-key` type, the resource will also create a deploy key in your VCS repository, which will not be deleted in case of Terraform destroy. Requires manual clean up.

## Import

Checkout Keys can be imported using the project name and the fingerprint.
```bash
$ terraform import circleci_checkout_key.key "my-project/12:34:56:78:90:12:34:56:78:90:12:34:56:78:90:12"
```
35 changes: 35 additions & 0 deletions docs/resources/context.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "circleci_context Resource - terraform-provider-circleci"
subcategory: ""
description: |-
---

# circleci_context (Resource)

## Usage
```hcl
resource "circleci_context" "my_context" {
name = "my-awesome-context"
}
```


<!-- schema generated by tfplugindocs -->
## Schema

### Required

- `name` (String) The name of the context

### Read-Only

- `id` (String) The ID of this resource.

## Import

Contexts can be imported using their names:
```bash
$ terraform import circleci_context.context my-context
```
73 changes: 73 additions & 0 deletions docs/resources/context_environment_variable.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "circleci_context_environment_variable Resource - terraform-provider-circleci"
subcategory: ""
description: |-
---

# circleci_context_environment_variable (Resource)

## Usage
Environment variables can be created using a context name:
```hcl
resource "circleci_context_environment_variable" "var" {
context = "my-context"
name = "DUMMY"
value = "VALUE"
}
```

Or using a data source for the context name:
```hcl
data "circleci_context" "context" {
name = "my-context"
}
resource "circleci_context_environment_variable" "var" {
context = data.circleci_context.context.name
name = "DUMMY"
value = "VALUE"
}
```

Or using a context resource:
```hcl
resource "circleci_context" "context" {
name = "my-context"
}
resource "circleci_context_environment_variable" "var" {
context = circleci_context.context.name
name = "DUMMY"
value = "VALUE"
}
```


<!-- schema generated by tfplugindocs -->
## Schema

### Required

- `context` (String) The name of the context where the environment variable is defined
- `name` (String) The name of the environment variable
- `value` (String, Sensitive) The value that will be set for the environment variable.

### Read-Only

- `id` (String) The ID of this resource.

## Import

Contexts' environment variables can be imported using the context name and the variable
name:
```bash
$ terraform import circleci_context_environment_variable.var my-context/MY_VARIABLE
```

~> Importing a variable does not support importing the variable value since it is marked
as sensitive.
71 changes: 71 additions & 0 deletions docs/resources/environment_variable.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "circleci_environment_variable Resource - terraform-provider-circleci"
subcategory: ""
description: |-
---

# circleci_environment_variable (Resource)

## Usage
Environment variables can be created using a project name:
```hcl
resource "circleci_environment_variable" "variable" {
project = "my-project"
name = "DUMMY"
value = "VALUE"
}
```

Or using a project data source:
```hcl
data "circleci_project" "project" {
name = "my-project"
}
resource "circleci_environment_variable" "variable" {
project = data.circleci_project.project.name
name = "DUMMY"
value = "VALUE"
}
```

<!-- schema generated by tfplugindocs -->
## Schema

### Required

- `name` (String) The name of the environment variable
- `project` (String) The name of the CircleCI project to create the variable in
- `value` (String, Sensitive) The value of the environment variable

### Optional

- `timeouts` (Block, Optional) (see [below for nested schema](#nestedblock--timeouts))

### Read-Only

- `id` (String) The ID of this resource.

<a id="nestedblock--timeouts"></a>
### Nested Schema for `timeouts`

Optional:

- `create` (String)
- `delete` (String)

## Import

Projects' environment variables can be imported using the project name and the variable
name:
```bash
$ terraform import circleci_environment_variable.var my-project/MY_VARIABLE
```

~> Importing a variable does not support importing the variable value since it is marked
as sensitive.

0 comments on commit fc6d0c9

Please sign in to comment.