-
Notifications
You must be signed in to change notification settings - Fork 178
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
doc: Updates to new Terraform doc structure #2425
Changes from 17 commits
32fb2ef
d9730c4
d628c1a
d1b781f
eee10e1
69ae725
34eed2a
038b2a6
c82f824
d8d8243
c0ddade
520952b
70aa0e7
5a4bde9
276ecbc
7e60d9b
4a3006c
0716afb
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,6 @@ | ||
# Maintained by the MongoDB APIx-Integrations team | ||
* @mongodb/APIx-Integrations | ||
|
||
|
||
# Changelog entries reviewed by Docs Cloud Team | ||
/.changelog/ @mongodb/docs-cloud-team | ||
/website/ @mongodb/docs-cloud-team | ||
/docs/ @mongodb/docs-cloud-team |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -75,7 +75,6 @@ lint: | |
tools: ## Install dev tools | ||
@echo "==> Installing dependencies..." | ||
go install github.com/icholy/gomajor@latest | ||
go install github.com/client9/misspell/cmd/misspell@latest | ||
go install github.com/terraform-linters/[email protected] | ||
go install github.com/rhysd/actionlint/cmd/actionlint@latest | ||
go install golang.org/x/tools/go/analysis/passes/fieldalignment/cmd/fieldalignment@latest | ||
|
@@ -86,13 +85,8 @@ tools: ## Install dev tools | |
go install github.com/hashicorp/go-changelog/cmd/changelog-entry@latest | ||
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(shell go env GOPATH)/bin $(GOLANGCI_VERSION) | ||
|
||
.PHONY: website-lint | ||
website-lint: | ||
@echo "==> Checking website against linters..." | ||
@misspell -error -source=text website/ | ||
|
||
.PHONY: website | ||
website: | ||
.PHONY: docs | ||
docs: | ||
@echo "Use this site to preview markdown rendering: https://registry.terraform.io/tools/doc-preview" | ||
|
||
.PHONY: tflint | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
# Resource: mongodbatlas_ldap_configuration | ||
|
||
`mongodbatlas_ldap_configuration` provides an LDAP Configuration resource. This allows an LDAP configuration for an Atlas project to be crated and managed. This endpoint doesn’t verify connectivity using the provided LDAP over TLS configuration details. To verify a configuration before saving it, use the resource to [verify](https://github.com/mongodb/terraform-provider-mongodbatlas/blob/INTMDB-114/website/docs/r/ldap_verify.html.markdown) the LDAP configuration. | ||
`mongodbatlas_ldap_configuration` provides an LDAP Configuration resource. This allows an LDAP configuration for an Atlas project to be crated and managed. This endpoint doesn’t verify connectivity using the provided LDAP over TLS configuration details. To verify a configuration before saving it, use the resource to [verify](https://github.com/mongodb/terraform-provider-mongodbatlas/blob/master/docs/resources/ldap_verify.md) the LDAP configuration. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Just want to confirm if this is supposed to be: this allows an LDAP configuration for an Atlas project to be created and managed There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. thanks, it's a typo, changed, fixed in this commit: 0716afb |
||
|
||
## Example Usage | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -34,6 +34,14 @@ resource "mongodbatlas_push_based_log_export" "test" { | |
iam_role_id = mongodbatlas_cloud_provider_access_authorization.auth_role.role_id | ||
prefix_path = "push-based-log-test" | ||
} | ||
|
||
data "mongodbatlas_push_based_log_export" "test" { | ||
project_id = mongodbatlas_push_based_log_export.test.project_id | ||
} | ||
|
||
output "test" { | ||
value = data.mongodbatlas_push_based_log_export.test.prefix_path | ||
} | ||
``` | ||
|
||
<!-- schema generated by tfplugindocs --> | ||
|
@@ -43,12 +51,13 @@ resource "mongodbatlas_push_based_log_export" "test" { | |
|
||
- `bucket_name` (String) The name of the bucket to which the agent sends the logs to. | ||
- `iam_role_id` (String) ID of the AWS IAM role that is used to write to the S3 bucket. | ||
- `prefix_path` (String) S3 directory in which vector writes in order to store the logs. An empty string denotes the root directory. | ||
- `project_id` (String) Unique 24-hexadecimal digit string that identifies your project. Use the [/groups](#tag/Projects/operation/listProjects) endpoint to retrieve all projects to which the authenticated user has access. | ||
|
||
**NOTE**: Groups and projects are synonymous terms. Your group id is the same as your project id. For existing groups, your group/project id remains the same. The resource and corresponding endpoints use the term groups. | ||
|
||
### Optional | ||
|
||
- `prefix_path` (String) S3 directory in which vector writes in order to store the logs. An empty string denotes the root directory. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. it's indeed optional:
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good catch 👍 |
||
- `timeouts` (Attributes) (see [below for nested schema](#nestedatt--timeouts)) | ||
|
||
### Read-Only | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -32,7 +32,7 @@ | |
|
||
set -euo pipefail | ||
|
||
TF_VERSION="${TF_VERSION:-"1.7"}" # TF version to use when running tfplugindocs. Default: 1.7 | ||
TF_VERSION="${TF_VERSION:-"1.9.2"}" # TF version to use when running tfplugindocs. Default: 1.9.2 | ||
TEMPLATE_FOLDER_PATH="${TEMPLATE_FOLDER_PATH:-"templates"}" # PATH to the templates folder. Default: templates | ||
|
||
|
||
|
@@ -67,39 +67,35 @@ if [ ! -f "${TEMPLATE_FOLDER_PATH}/data-sources/${resource_name}s.md.tmpl" ]; th | |
printf "Skipping this check: We assume that the resource does not have a plural data source.\n\n" | ||
fi | ||
|
||
# tfplugindocs uses this folder to generate the documentations | ||
mkdir -p docs | ||
tfplugindocs generate --tf-version "${TF_VERSION}" --website-source-dir "${TEMPLATE_FOLDER_PATH}" --rendered-website-dir "docs-out" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. use temporary docs-out folder so docs folder is not overwritten |
||
|
||
tfplugindocs generate --tf-version "${TF_VERSION}" --website-source-dir "${TEMPLATE_FOLDER_PATH}" | ||
|
||
if [ ! -f "docs/resources/${resource_name}.md" ]; then | ||
if [ ! -f "docs-out/resources/${resource_name}.md" ]; then | ||
echo "Error: We cannot find the documentation file for the resource ${resource_name}.md" | ||
echo "Please, make sure to include the resource template under templates/resources/${resource_name}.md.tmpl" | ||
printf "Skipping this step: We assume that only a data source is being generated.\n\n" | ||
else | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. files are already in correct new folder with new name There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nice that you contemplated adjusting this script. I am however concerned this will now not work as expected because There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. thanks @AgustinBettati , you're right all files are overwritten not only the specified resource. I think this commit should fix it: 4a3006c |
||
printf "\nMoving the generated file %s.md to the website folder" "${resource_name}" | ||
mv "docs/resources/${resource_name}.md" "website/docs/r/${resource_name}.html.markdown" | ||
printf "Moving the generated resource file %s.md to the website folder.\n" "${resource_name}" | ||
mv "docs-out/resources/${resource_name}.md" "docs/resources/${resource_name}.md" | ||
fi | ||
|
||
if [ ! -f "docs/data-sources/${resource_name}.md" ]; then | ||
if [ ! -f "docs-out/data-sources/${resource_name}.md" ]; then | ||
echo "Error: We cannot find the documentation file for the data source ${resource_name}.md" | ||
echo "Please, make sure to include the data source template under templates/data-sources/${resource_name}.md.tmpl" | ||
exit 1 | ||
else | ||
printf "\nMoving the generated file %s.md to the website folder" "${resource_name}" | ||
mv "docs/data-sources/${resource_name}.md" "website/docs/d/${resource_name}.html.markdown" | ||
printf "Moving the generated data-source file %s.md to the website folder.\n" "${resource_name}" | ||
mv "docs-out/data-sources/${resource_name}.md" "docs/data-sources/${resource_name}.md" | ||
fi | ||
|
||
if [ ! -f "docs/data-sources/${resource_name}s.md" ]; then | ||
echo "Warning: We cannot find the documentation file for the data source ${resource_name}s.md." | ||
if [ ! -f "docs-out/data-sources/${resource_name}s.md" ]; then | ||
echo "Warning: We cannot find the documentation file for the plural data source ${resource_name}s.md." | ||
echo "Please, make sure to include the data source template under templates/data-sources/${resource_name}s.md.tmpl" | ||
printf "Skipping this step: We assume that the resource does not have a plural data source.\n\n" | ||
else | ||
printf "\nMoving the generated file %s.md to the website folder" "${resource_name}s" | ||
mv "docs/data-sources/${resource_name}s.md" "website/docs/d/${resource_name}s.html.markdown" | ||
printf "\nMoving the generated plural data-source file %s.md to the website folder.\n" "${resource_name}s" | ||
mv "docs-out/data-sources/${resource_name}s.md" "docs/data-sources/${resource_name}s.md" | ||
fi | ||
|
||
# Delete the docs/ folder | ||
rm -R docs/ | ||
rm -R docs-out/ | ||
|
||
printf "\nThe documentation for %s has been created.\n" "${resource_name}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
as in PR description, website-lint is deleted