Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

docs: add import examples#118

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
ethanndickson merged 1 commit intomainfromethan/import-examples
Oct 24, 2024
Merged
Show file tree
Hide file tree
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 18 additions & 3 deletionsdocs/resources/group.md
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -5,7 +5,6 @@ subcategory: ""
description: |-
A group on the Coder deployment.
Creating groups requires an Enterprise license.
When importing, the ID supplied can be either a group UUID retrieved via the API or <organization-name>/<group-name>.
---

# coderd_group (Resource)
Expand All@@ -14,8 +13,6 @@ A group on the Coder deployment.

Creating groups requires an Enterprise license.

When importing, the ID supplied can be either a group UUID retrieved via the API or `<organization-name>/<group-name>`.

## Example Usage

```terraform
Expand DownExpand Up@@ -62,3 +59,21 @@ resource "coderd_group" "group1" {
### Read-Only

- `id` (String) Group ID.

## Import

Import is supported using the following syntax:

```shell
# The ID supplied can be either a group UUID retrieved via the API
# or a fully qualified name: `<organization-name>/<group-name>`.
$ terraform import coderd_group.example coder/developers
```
Alternatively, in Terraform v1.5.0 and later, an [`import` block](https://developer.hashicorp.com/terraform/language/import) can be used:

```terraform
import {
to = coderd_group.example
id = "coder/developers"
}
```
25 changes: 22 additions & 3 deletionsdocs/resources/template.md
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -5,7 +5,6 @@ subcategory: ""
description: |-
A Coder template.
Logs from building template versions can be optionally streamed from the provisioner by setting the TF_LOG environment variable to INFO or higher.
When importing, the ID supplied can be either a template UUID retrieved via the API or <organization-name>/<template-name>.
---

# coderd_template (Resource)
Expand All@@ -14,8 +13,6 @@ A Coder template.

Logs from building template versions can be optionally streamed from the provisioner by setting the `TF_LOG` environment variable to `INFO` or higher.

When importing, the ID supplied can be either a template UUID retrieved via the API or `<organization-name>/<template-name>`.

## Example Usage

```terraform
Expand DownExpand Up@@ -164,3 +161,25 @@ Optional:

- `days_of_week` (Set of String) List of days of the week on which restarts are required. Restarts happen within the user's quiet hours (in their configured timezone). If no days are specified, restarts are not required.
- `weeks` (Number) Weeks is the number of weeks between required restarts. Weeks are synced across all workspaces (and Coder deployments) using modulo math on a hardcoded epoch week of January 2nd, 2023 (the first Monday of 2023). Values of 0 or 1 indicate weekly restarts. Values of 2 indicate fortnightly restarts, etc.

## Import

Import is supported using the following syntax:

```shell
# The ID supplied can be either a template UUID retrieved via the API
# or a fully qualified name: `<organization-name>/<template-name>`.
$ terraform import coderd_template.example coder/dogfood
```
Once imported, you'll need to manually declare in your config:
- The `versions` list, in order to specify the source directories for new versions of the template.
- (Enterprise) The `acl` attribute, in order to specify the users and groups that have access to the template.

Alternatively, in Terraform v1.5.0 and later, an [`import` block](https://developer.hashicorp.com/terraform/language/import) can be used:

```terraform
import {
to = coderd_template.example
id = "coder/dogfood"
}
```
21 changes: 18 additions & 3 deletionsdocs/resources/user.md
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -4,15 +4,12 @@ page_title: "coderd_user Resource - terraform-provider-coderd"
subcategory: ""
description: |-
A user on the Coder deployment.
When importing, the ID supplied can be either a user UUID or a username.
---

# coderd_user (Resource)

A user on the Coder deployment.

When importing, the ID supplied can be either a user UUID or a username.

## Example Usage

```terraform
Expand DownExpand Up@@ -65,3 +62,21 @@ resource "coderd_user" "admin" {
### Read-Only

- `id` (String) User ID

## Import

Import is supported using the following syntax:

```shell
# The ID supplied can be either a user UUID retrieved via the API
# or a username.
$ terraform import coderd_user.example developer
```
Alternatively, in Terraform v1.5.0 and later, an [`import` block](https://developer.hashicorp.com/terraform/language/import) can be used:

```terraform
import {
to = coderd_user.example
id = "developer"
}
```
11 changes: 11 additions & 0 deletionsexamples/resources/coderd_group/import.sh
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
# The ID supplied can be either a group UUID retrieved via the API
# or a fully qualified name: `<organization-name>/<group-name>`.
$ terraform import coderd_group.example coder/developers
```
Alternatively, in Terraform v1.5.0 and later, an [`import` block](https://developer.hashicorp.com/terraform/language/import) can be used:

```terraform
import {
to = coderd_group.example
id = "coder/developers"
}
15 changes: 15 additions & 0 deletionsexamples/resources/coderd_template/import.sh
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
# The ID supplied can be either a template UUID retrieved via the API
# or a fully qualified name: `<organization-name>/<template-name>`.
$ terraform import coderd_template.example coder/dogfood
```
Once imported, you'll need to manually declare in your config:
- The `versions` list, in order to specify the source directories for new versions of the template.
- (Enterprise) The `acl` attribute, in order to specify the users and groups that have access to the template.

Alternatively, in Terraform v1.5.0 and later, an [`import` block](https://developer.hashicorp.com/terraform/language/import) can be used:

```terraform
import {
to = coderd_template.example
id = "coder/dogfood"
}
11 changes: 11 additions & 0 deletionsexamples/resources/coderd_user/import.sh
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
# The ID supplied can be either a user UUID retrieved via the API
# or a username.
$ terraform import coderd_user.example developer
```
Alternatively, in Terraform v1.5.0 and later, an [`import` block](https://developer.hashicorp.com/terraform/language/import) can be used:

```terraform
import {
to = coderd_user.example
id = "developer"
}
3 changes: 1 addition & 2 deletionsinternal/provider/group_resource.go
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -62,8 +62,7 @@ func (r *GroupResource) Metadata(ctx context.Context, req resource.MetadataReque
func (r *GroupResource) Schema(ctx context.Context, req resource.SchemaRequest, resp *resource.SchemaResponse) {
resp.Schema = schema.Schema{
MarkdownDescription: "A group on the Coder deployment.\n\n" +
"Creating groups requires an Enterprise license.\n\n" +
"When importing, the ID supplied can be either a group UUID retrieved via the API or `<organization-name>/<group-name>`.",
"Creating groups requires an Enterprise license.",

Attributes: map[string]schema.Attribute{
"id": schema.StringAttribute{
Expand Down
4 changes: 1 addition & 3 deletionsinternal/provider/template_resource.go
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -243,9 +243,7 @@ func (r *TemplateResource) Metadata(ctx context.Context, req resource.MetadataRe
func (r *TemplateResource) Schema(ctx context.Context, req resource.SchemaRequest, resp *resource.SchemaResponse) {
resp.Schema = schema.Schema{
MarkdownDescription: "A Coder template.\n\nLogs from building template versions can be optionally streamed from the provisioner " +
"by setting the `TF_LOG` environment variable to `INFO` or higher.\n\n" +
"When importing, the ID supplied can be either a template UUID retrieved via the API or `<organization-name>/<template-name>`.",

"by setting the `TF_LOG` environment variable to `INFO` or higher.",
Attributes: map[string]schema.Attribute{
"id": schema.StringAttribute{
MarkdownDescription: "The ID of the template.",
Expand Down
3 changes: 1 addition & 2 deletionsinternal/provider/user_resource.go
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -56,8 +56,7 @@ func (r *UserResource) Metadata(ctx context.Context, req resource.MetadataReques

func (r *UserResource) Schema(ctx context.Context, req resource.SchemaRequest, resp *resource.SchemaResponse) {
resp.Schema = schema.Schema{
MarkdownDescription: "A user on the Coder deployment.\n\n" +
"When importing, the ID supplied can be either a user UUID or a username.",
MarkdownDescription: "A user on the Coder deployment.",

Attributes: map[string]schema.Attribute{
"id": schema.StringAttribute{
Expand Down
Loading

[8]ページ先頭

©2009-2025 Movatter.jp