Skip to content

Commit e27da8a

Browse files
committed
Update documentation and examples
1 parent a795dcf commit e27da8a

File tree

13 files changed

+41
-43
lines changed

13 files changed

+41
-43
lines changed

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
# Terraform Provider Scaffolding (Terraform Plugin Framework)
1+
# Terraform Provider lifecycle-debug (Terraform Plugin Framework)
22

3-
_This template repository is built on the [Terraform Plugin Framework](https://github.com/hashicorp/terraform-plugin-framework). The template repository built on the [Terraform Plugin SDK](https://github.com/hashicorp/terraform-plugin-sdk) can be found at [terraform-provider-scaffolding](https://github.com/hashicorp/terraform-provider-scaffolding). See [Which SDK Should I Use?](https://developer.hashicorp.com/terraform/plugin/framework-benefits) in the Terraform documentation for additional information._
3+
_This repository implements the lifecycle-debug provider using the [Terraform Plugin Framework](https://github.com/hashicorp/terraform-plugin-framework)._
44

5-
This repository is a *template* for a [Terraform](https://www.terraform.io) provider. It is intended as a starting point for creating Terraform providers, containing:
5+
This repository started from the HashiCorp provider template and now contains:
66

77
- A resource and a data source (`internal/provider/`),
8-
- Examples (`examples/`) and generated documentation (`docs/`),
8+
- lifecycle-debug examples (`examples/`) and generated documentation (`docs/`),
99
- Miscellaneous meta files.
1010

1111
These files contain boilerplate code that you will need to edit to create your own Terraform provider. Tutorials for creating Terraform providers can be found on the [HashiCorp Developer](https://developer.hashicorp.com/terraform/tutorials/providers-plugin-framework) platform. _Terraform Plugin Framework specific guides are titled accordingly._

docs/index.md

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,21 @@
11
---
22
# generated by https://github.com/hashicorp/terraform-plugin-docs
3-
page_title: "scaffolding Provider"
3+
page_title: "lifecycle-debug Provider"
44
description: |-
55
66
---
77

8-
# scaffolding Provider
8+
# lifecycle-debug Provider
99

1010

1111

1212
## Example Usage
1313

1414
```terraform
15-
provider "scaffolding" {
16-
# example configuration here
15+
provider "lifecycle-debug" {
16+
# lifecycle-debug configuration here
1717
}
1818
```
1919

2020
<!-- schema generated by tfplugindocs -->
2121
## Schema
22-
23-
### Optional
24-
25-
- `endpoint` (String) Example provider attribute
Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
---
22
# generated by https://github.com/hashicorp/terraform-plugin-docs
3-
page_title: "scaffolding_example Resource - scaffolding"
3+
page_title: "lifecycle-debug Resource - lifecycle-debug"
44
subcategory: ""
55
description: |-
6-
Example resource
6+
Lifecycle debug resource
77
---
88

9-
# scaffolding_example (Resource)
9+
# lifecycle-debug (Resource)
1010

11-
Example resource
11+
Lifecycle debug resource
1212

1313
## Example Usage
1414

1515
```terraform
16-
resource "scaffolding_example" "example" {
16+
resource "lifecycle-debug" "lifecycle-debug" {
1717
configurable_attribute = "some-value"
1818
}
1919
```
@@ -23,12 +23,11 @@ resource "scaffolding_example" "example" {
2323

2424
### Optional
2525

26-
- `configurable_attribute` (String) Example configurable attribute
27-
- `defaulted` (String) Example configurable attribute with default value
26+
- `log_command` (String) Command to receive lifecycle debug logs via stdin for this resource
2827

2928
### Read-Only
3029

31-
- `id` (String) Example identifier
30+
- `id` (String) Lifecycle debug identifier
3231

3332
## Import
3433

@@ -37,5 +36,5 @@ Import is supported using the following syntax:
3736
The [`terraform import` command](https://developer.hashicorp.com/terraform/cli/commands/import) can be used, for example:
3837

3938
```shell
40-
terraform import scaffolding_example.test "id-123"
39+
terraform import lifecycle-debug.lifecycle-debug "id-123"
4140
```

examples/provider/provider.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
provider "lifecycle-debug" {
2-
# example configuration here
2+
# lifecycle-debug configuration here
33
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
terraform import lifecycle-debug.lifecycle-debug "id-123"
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
resource "lifecycle-debug" "lifecycle-debug" {
2+
configurable_attribute = "some-value"
3+
}

examples/resources/scaffolding_example/import.sh

Lines changed: 0 additions & 1 deletion
This file was deleted.

examples/resources/scaffolding_example/resource.tf

Lines changed: 0 additions & 3 deletions
This file was deleted.

internal/provider/example_resource.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ func (r *LifecycleDebugResource) Schema(ctx context.Context, req resource.Schema
4848

4949
resp.Schema = schema.Schema{
5050
// This description is used by the documentation generator and the language server.
51-
MarkdownDescription: "Example resource",
51+
MarkdownDescription: "Lifecycle debug resource",
5252

5353
Attributes: map[string]schema.Attribute{
5454
"id": schema.StringAttribute{
@@ -111,13 +111,13 @@ func (r *LifecycleDebugResource) Create(ctx context.Context, req resource.Create
111111
// provider client data and make a call using it.
112112
// httpResp, err := r.client.Do(httpReq)
113113
// if err != nil {
114-
// resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Unable to create example, got error: %s", err))
114+
// resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Unable to create lifecycle-debug resource, got error: %s", err))
115115
// return
116116
// }
117117

118-
// For the purposes of this example code, hardcoding a response value to
118+
// For the purposes of this lifecycle-debug code, hardcoding a response value to
119119
// save into the Terraform state.
120-
data.Id = types.StringValue("example-id")
120+
data.Id = types.StringValue("lifecycle-debug-id")
121121

122122
// Save data into Terraform state
123123
resp.Diagnostics.Append(resp.State.Set(ctx, &data)...)
@@ -142,7 +142,7 @@ func (r *LifecycleDebugResource) Read(ctx context.Context, req resource.ReadRequ
142142
// provider client data and make a call using it.
143143
// httpResp, err := r.client.Do(httpReq)
144144
// if err != nil {
145-
// resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Unable to read example, got error: %s", err))
145+
// resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Unable to read lifecycle-debug resource, got error: %s", err))
146146
// return
147147
// }
148148

@@ -169,7 +169,7 @@ func (r *LifecycleDebugResource) Update(ctx context.Context, req resource.Update
169169
// provider client data and make a call using it.
170170
// httpResp, err := r.client.Do(httpReq)
171171
// if err != nil {
172-
// resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Unable to update example, got error: %s", err))
172+
// resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Unable to update lifecycle-debug resource, got error: %s", err))
173173
// return
174174
// }
175175

@@ -197,7 +197,7 @@ func (r *LifecycleDebugResource) Delete(ctx context.Context, req resource.Delete
197197
// provider client data and make a call using it.
198198
// httpResp, err := r.client.Do(httpReq)
199199
// if err != nil {
200-
// resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Unable to delete example, got error: %s", err))
200+
// resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Unable to delete lifecycle-debug resource, got error: %s", err))
201201
// return
202202
// }
203203
}

internal/provider/example_resource_test.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,12 @@ func TestAccLifecycleDebugResource(t *testing.T) {
2525
statecheck.ExpectKnownValue(
2626
"lifecycle-debug.test",
2727
tfjsonpath.New("id"),
28-
knownvalue.StringExact("example-id"),
28+
knownvalue.StringExact("lifecycle-debug-id"),
2929
),
3030
statecheck.ExpectKnownValue(
3131
"lifecycle-debug.test",
3232
tfjsonpath.New("defaulted"),
33-
knownvalue.StringExact("example value when not configured"),
33+
knownvalue.StringExact("lifecycle-debug value when not configured"),
3434
),
3535
statecheck.ExpectKnownValue(
3636
"lifecycle-debug.test",
@@ -45,7 +45,7 @@ func TestAccLifecycleDebugResource(t *testing.T) {
4545
ImportState: true,
4646
ImportStateVerify: true,
4747
// This is not normally necessary, but is here because this
48-
// example code does not have an actual upstream service.
48+
// lifecycle-debug code does not have an actual upstream service.
4949
// Once the Read method is able to refresh information from
5050
// the upstream service, this can be removed.
5151
ImportStateVerifyIgnore: []string{"configurable_attribute", "defaulted"},
@@ -57,12 +57,12 @@ func TestAccLifecycleDebugResource(t *testing.T) {
5757
statecheck.ExpectKnownValue(
5858
"lifecycle-debug.test",
5959
tfjsonpath.New("id"),
60-
knownvalue.StringExact("example-id"),
60+
knownvalue.StringExact("lifecycle-debug-id"),
6161
),
6262
statecheck.ExpectKnownValue(
6363
"lifecycle-debug.test",
6464
tfjsonpath.New("defaulted"),
65-
knownvalue.StringExact("example value when not configured"),
65+
knownvalue.StringExact("lifecycle-debug value when not configured"),
6666
),
6767
statecheck.ExpectKnownValue(
6868
"lifecycle-debug.test",

0 commit comments

Comments
 (0)