You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/content/develop/add-handwritten-datasource.md
+2-2
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,7 @@
1
1
---
2
2
title: "Add a datasource"
3
3
summary: "Datasources are like terraform resources except they don't *create* anything."
4
-
weight: 40
4
+
weight: 14
5
5
aliases:
6
6
- /docs/how-to/add-handwritten-datasource
7
7
- /how-to/add-handwritten-datasource
@@ -52,5 +52,5 @@ library, or the raw HTTP client used in MMV1 through `SendRequest`.
52
52
1. Open the data source documentation in [`magic-modules/third_party/terraform/website/docs/d/`](https://github.com/GoogleCloudPlatform/magic-modules/tree/main/mmv1/third_party/terraform/website/docs/d) using an editor of your choice.
53
53
- The name of the file is the name of the data source without a `google_` prefix. For example, for `google_compute_instance`, the file is called `compute_instance.html.markdown`
54
54
2. Modify the documentation as needed according to [Handwritten documentation style guide]({{< ref "/develop/handwritten-docs-style-guide" >}}).
55
-
4.[Generate the providers]({{< ref "/get-started/generate-providers.md" >}})
55
+
4.[Generate the providers]({{< ref "/develop/generate-providers" >}})
56
56
5. Copy and paste the generated documentation into the Hashicorp Registry's [Doc Preview Tool](https://registry.terraform.io/tools/doc-preview) to see how it is rendered.
Copy file name to clipboardExpand all lines: docs/content/develop/custom-code.md
+2-2
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
---
2
2
title: "Add custom resource code"
3
-
weight: 39
3
+
weight: 15
4
4
---
5
5
6
6
# Add custom resource code
@@ -17,7 +17,7 @@ custom_code:
17
17
18
18
By convention, the template files are stored in a directory matching the type of custom code, and the name of the file includes the resource (and, if relevant, field) impacted by the custom code. Like handwritten resource and test code, custom code is written as go templates which render go code.
19
19
20
-
When in doubt about the behavior of custom code, write the custom code, [generate the providers]({{< ref "/get-started/generate-providers" >}}), and inspect what changed in the providers using `git diff`.
20
+
When in doubt about the behavior of custom code, write the custom code, [generate the providers]({{< ref "/develop/generate-providers" >}}), and inspect what changed in the providers using `git diff`.
21
21
22
22
The following sections describe types of custom code in more detail.
Copy file name to clipboardExpand all lines: docs/content/develop/promote-to-ga.md
+2-2
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
---
2
2
title: "Promote to GA"
3
-
weight: 50
3
+
weight: 16
4
4
---
5
5
6
6
# Promote from beta to GA
@@ -13,7 +13,7 @@ For more information about types of resources and the generation process overall
13
13
14
14
## Before you begin
15
15
16
-
1. Complete the [Generate the providers]({{< ref "/get-started/generate-providers" >}}) quickstart to set up your environment and your Google Cloud project.
16
+
1. Complete the steps in [Set up your development environment]({{< ref "/develop/set-up-dev-environment" >}}) to set up your environment and your Google Cloud project.
17
17
2. Ensure that your `magic-modules`, `terraform-provider-google`, and `terraform-provider-google-beta` repositories are up to date.
Copy file name to clipboardExpand all lines: docs/content/develop/resource.md
+6-6
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
---
2
2
title: "Add or modify a resource"
3
-
weight: 30
3
+
weight: 13
4
4
aliases:
5
5
- /docs/how-to/add-mmv1-resource
6
6
- /how-to/add-mmv1-resource
@@ -31,7 +31,7 @@ For more information about types of resources and the generation process overall
31
31
32
32
## Before you begin
33
33
34
-
1. Complete the steps in [Generate the providers]({{< ref "/get-started/generate-providers" >}}) to set up your environment and your Google Cloud project.
34
+
1. Complete the steps in [Set up your development environment]({{< ref "/develop/set-up-dev-environment" >}}) to set up your environment and your Google Cloud project.
35
35
2. Ensure that your `magic-modules`, `terraform-provider-google`, and `terraform-provider-google-beta` repositories are up to date.
36
36
```
37
37
cd ~/magic-modules
@@ -151,7 +151,7 @@ For more information about types of resources and the generation process overall
151
151
> **Warning:** Handwritten resources are more difficult to develop and maintain. New handwritten resources will only be accepted if implementing the resource in MMv1 would require entirely overriding two or more CRUD methods.
152
152
153
153
1. Add the resource in MMv1.
154
-
2.[Generate the beta provider]({{< ref "/get-started/generate-providers.md" >}})
154
+
2.[Generate the beta provider]({{< ref "/develop/generate-providers.md" >}})
155
155
3. From the beta provider, copy the files generated for the resource to the following locations:
156
156
- Resource: Copy to the appropriate service folder inside [`magic-modules/mmv1/third_party/terraform/services`](https://github.com/GoogleCloudPlatform/magic-modules/tree/main/mmv1/third_party/terraform/services)
### Convert to handwritten (not usually necessary)
422
422
423
-
1.[Generate the beta provider]({{< ref "/get-started/generate-providers.md" >}})
423
+
1.[Generate the beta provider]({{< ref "/develop/generate-providers.md" >}})
424
424
2. From the beta provider, copy the files generated for the IAM resources to the following locations:
425
425
- Resource: Copy to the appropriate service folder inside [`magic-modules/mmv1/third_party/terraform/services`](https://github.com/GoogleCloudPlatform/magic-modules/tree/main/mmv1/third_party/terraform/services)
Documentation is autogenerated based on the resource and field configurations. To preview the documentation:
444
444
445
-
1.[Generate the providers]({{< ref "/get-started/generate-providers.md" >}})
445
+
1.[Generate the providers]({{< ref "/develop/generate-providers.md" >}})
446
446
2. Copy and paste the generated documentation into the Hashicorp Registry's [Doc Preview Tool](https://registry.terraform.io/tools/doc-preview) to see how it is rendered.
447
447
{{< /tab >}}
448
448
{{< tab "Handwritten" >}}
@@ -451,7 +451,7 @@ Documentation is autogenerated based on the resource and field configurations. T
451
451
1. Open the resource documentation in [`magic-modules/third_party/terraform/website/docs/r/`](https://github.com/GoogleCloudPlatform/magic-modules/tree/main/mmv1/third_party/terraform/website/docs/r) using an editor of your choice.
452
452
- The name of the file is the name of the resource without a `google_` prefix. For example, for `google_compute_instance`, the file is called `compute_instance.html.markdown`
453
453
2. Modify the documentation as needed according to [Handwritten documentation style guide]({{< ref "/develop/handwritten-docs-style-guide" >}}).
454
-
3.[Generate the providers]({{< ref "/get-started/generate-providers.md" >}})
454
+
3.[Generate the providers]({{< ref "/develop/generate-providers.md" >}})
455
455
4. Copy and paste the generated documentation into the Hashicorp Registry's [Doc Preview Tool](https://registry.terraform.io/tools/doc-preview) to see how it is rendered.
Copy file name to clipboardExpand all lines: docs/content/develop/test/test.md
+3-3
Original file line number
Diff line number
Diff line change
@@ -100,7 +100,7 @@ This section assumes you've used the [Add a resource]({{< ref "/develop/resource
100
100
> **Note:** If not, you can create one now, or skip this guide and construct the test by hand. Writing tests by hand can sometimes be a better option if there is a similar test you can copy from.
101
101
102
102
1. Add the test in MMv1. Repeat for all the create tests you will need.
103
-
2. [Generate the beta provider]({{< ref "/get-started/generate-providers.md" >}}).
103
+
2. [Generate the beta provider]({{< ref "/develop/generate-providers.md" >}}).
104
104
3. From the beta provider, copy and paste the generated `*_generated_test.go` file into the appropriate service folder inside [`magic-modules/mmv1/third_party/terraform/services`](https://github.com/GoogleCloudPlatform/magic-modules/tree/main/mmv1/third_party/terraform/services/) as a new file call `*_test.go`.
105
105
4. Modify the tests as needed.
106
106
- Replace all occurrences of `github.com/hashicorp/terraform-provider-google-beta/google-beta` with `github.com/hashicorp/terraform-provider-google/google`
@@ -120,7 +120,7 @@ An update test is a test that creates the target resource and then makes updates
120
120
121
121
{{< tabs "update" >}}
122
122
{{< tab "MMv1" >}}
123
-
1. [Generate the beta provider]({{< ref "/get-started/generate-providers.md" >}}).
123
+
1. [Generate the beta provider]({{< ref "/develop/generate-providers" >}}).
124
124
2. From the beta provider, copy and paste the generated `*_generated_test.go` file into the appropriate service folder inside [`magic-modules/mmv1/third_party/terraform/services`](https://github.com/GoogleCloudPlatform/magic-modules/tree/main/mmv1/third_party/terraform/services) as a new file call `*_test.go`.
125
125
3. Using an editor of your choice, delete the `*DestroyProducer` function, and all but one test. The remaining test should be the "full" test, or if there is no "full" test, the "basic" test. This will be the starting point for your new update test.
126
126
4. Modify the `TestAcc*` *test function* to support updates.
0 commit comments