Giter VIP home page Giter VIP logo

terraform-docs-common's Issues

Integrations > Custom Framework vs Custom SDK

I'm unable to locate this documentation in the GH repos, although I'm sure it's here somewhere.

I went looking for docs on writing a custom TF provider, and found https://developer.hashicorp.com/terraform/tutorials/providers. In the left side gutter under "Integrations" are two nearly identical looking options for custom providers: "Custom Framework Providers" and "Custom SDK Providers". The description of both only varies in the name/title. It's entirely unclear why both are there and which to use. Screenshots attached for reference.

It's not until I went hunting for the answer that I found another page under "plugins" that explains the difference. It says

SDKv2 is the prior SDK that many existing providers use. It is maintained for Terraform versions 1.x and earlier, but we have stopped most feature development so we can focus on improving the framework.

To alleviate confusion and help developers move to use (or start with) the Plugin Framework, this description/explanation/suggestion above the tutorial TOC should include some form of the above statement making it clear that the SDK is not preferred.

Screenshot 2023-05-08 at 12 59 13
Screenshot 2023-05-08 at 12 59 22

Workspace Settings - Local Execution Mode - Explicitly state that team permissions are not gracefully regulated somehow

A customer is not satisfied that within the current iteration of our documentation regarding Execution Modes there's not an explicit statement about team permissions not getting gracefully regulated/upheld when using the local execution mode, and I'm struggling to figure out an eloquent way to do this.

For example:

You are running terraform apply against a workspace in your TFC org, where the team your token is associated to does not have permissions to upload state files, or run applies

If remote execution is selected, you'd get this message when you attempted to execute terraform apply:

PS C:\Users\zisom\Documents\exxon> terraform apply
╷
│ Error: Insufficient rights to apply changes
│
│ The provided credentials have insufficient rights to apply changes. In order to apply changes at least write permissions on the workspace are required.
╵
PS C:\Users\zisom\Documents\exxon> 

If local execution is selected, the apply phase would execute, and when the apply was finished and terraform attempts to upload the new state file you'd see this message:

null_resource.delay (local-exec):                                  [01]: 172.17.176.1
null_resource.delay (local-exec):                                  [02]: fe80::8167:3d5c:2f54:7577
null_resource.delay (local-exec): Hyper-V Requirements:      A hypervisor has been detected. Features required for Hyper-V will not be displayed.
null_resource.delay: Creation complete after 2s [id=2000534191006407307]
╷
│ Error: Failed to save state
│
│ Error saving state: Error uploading state: resource not found
╵
╷
│ Error: Failed to persist state to backend
│
│ The error shown above has prevented Terraform from writing the updated state to the configured backend. To allow for recovery, the state has been written to the 
│ file "errored.tfstate" in the current working directory.
│
│ Running "terraform apply" again at this point will create a forked state, making it harder to recover.
│
│ To retry writing this state, use the following command:
│     terraform state push errored.tfstate
│
╵

Through local execution, team permissions do not regulate the local execution of the binary. A person only would run into a situation with their permissions when there was an api call from the local binary that is not permitted, like in this case, uploading a state file. How can this be expressed within our documentation?

Expand Terraform Plugin Protocol Section

Use-cases

The current website documentation for Plugin Development discusses the Terraform Plugin Protocol but does not go into detail regarding the relationship between the RPCs that are issued by Terraform core during execution of a Terraform command and the Terraform plugin framework functions that are called as a consequence.

Proposal

In order to provide further clarification for provider developers and practitioners about the relationship and sequencing of RPCs and the functions that are called in the Terraform plugin framework it is proposed that Terraform Plugin Protocol be split into a separate page which adds this detail.

The Terraform plugin framework documentation will be updated to reference the relevant RPC within the new Terraform Plugin Protocol page.

References

The archive filename requirements are different between docs and actual behavior

Hi team, I was releasing a terraform provider and I met the following errors.

The doc says

There are 1 or more zip files containing the built provider binary for a single architecture.
The binary name is terraform-provider-{NAME}_v{VERSION}.
The archive name is terraform-provider-{NAME}_{VERSION}_{OS}_{ARCH}.zip.

But when I was doing this, and terraform init throws an error

│ Error: Failed to install provider
│
│ Error while installing azure/azapi v0.1.0: unsuccessful request to
│ https://github.com/Azure/terraform-provider-azapi/releases/download/v0.1.0/terraform-provider-azapi_v0.1.0_windows_amd64.zip: 404 Not Found
╵

Please notice the difference is v before version v0.1.0. After I renamed the archives by adding v before version, it works.

I think this is kind of strange that these files are not following the same pattern, zip files/binary files have v before version, but checksum file and signature file don't.

https://www.terraform.io/registry/providers/publishing?_ga=2.204875920.1848645224.1649644205-1459696673.1614833669#manually-preparing-a-release

Enterprise Docs' "Edit this page on GitHub" hyperlink is Invalid

The "Edit this page on GitHub" hyperlink on the bottom of every Enterprise doc page is invalid, as it's still referencing (presumably) an old repo. After reading the README of this repo, it does mention the repo for /enterprise is an internal repository, so I can't say for certain if the currently linked repo is deprecated or not as I do not have the needed access to verify.

I'd suggest that if the public is unable to access the docs and modify it themselves via the usual method of submitting a PR, then can we please have some other kind of link so that we can put in a request for changes to be made elsewhere?

Example:
https://developer.hashicorp.com/terraform/enterprise/api-docs/workspaces#show-workspace
image

website/docs/cloud-docs/api-docs/team-tokens.mdx does not document GET call

The Team Token API documentation page does not show that you can call GET /teams/:team_id/authentication-token to see if an team has an existing API token, and, if the token does exist, when it was created and by whom.

This appears to be the call app.terraform.io calls when you go to https://app.terraform.io/app/:organization/settings/team/:team_id to display the "Team API Token" section.

Fix table in azure-configuration.mdx

Hi!

I would love to introduce a minor fix specified in in #659 it fixes a table in the documentation.

Please do reach out if I can help facilitate this PR to be merged.

Thank you

Lacking proper navigation in official documentation

The documentation at https://developer.hashicorp.com/terraform/docs lacks proper navigation.
There are atleast 3 different ways to navigate the documentation, one from top nav, one from side bar and one from within the page (if this page is an index page)

As a first time user to terraform, I'd like to be able to properly read through documentation in a sequential manner ex: Prev, Next at the bottom of each page. The current documentation lacks this and I keep navigating pages repetitively selecting from top nav and side nav loosing my way constantly and get confused and lose interest

Terraform Cloud - Org Settings / Security / Authentication not documented?

Terraform Cloud org settings have session timeout settings that do not appear to be documented in any of the terraform cloud docs.

Located in TFC org settings, Authentication (Security subhead)

User Sessions
You can make changes here that will affect the sessions of all users in this organization.

These should be documented.

Question: What is 'resource-count' in the context of the workspace creation endpoint payload

The workspace creation endpoint has an undocumented 'resource-count' attribute.
This attribute does not appear in the list of attributes, but is included in each of the example payloads.

I can't see how creating a new workspace could/should contain this attribute or how the value would be calculated to pass to it, since at the point of creation, there wouldn't be any resources (at least 'resources' from a Terraform concept - but maybe this is a different type of resource?)

Any advice would be much appreciated - since it's included in both of the examples, I assume it's not a mistake, but happy to submit a PR to remove if it's incorrectly there :)

Many thanks

drift detection documentation typo

Description

The documentation around Drift Detection includes this statement:

Configuration drift occurs when changes are made outside Terrafoto's regular process, 
leading to inconsistencies between the remote objects and your configured infrastructure.

Assuming this is supposed to be Terraform's than Terrafoto's.

Incorrect attribute paths in table for variable set create method

In the variable sets documentation (https://github.com/hashicorp/terraform-website/blob/master/content/cloud-docs/api-docs/variable-sets.mdx) the table that specifies the required attributes doesn't quite line up with the payload below (the payload is correct).

The table lists the following fields:

data.name
data.description.
data.global

They should actually be:

data.attributes.name
data.attributes.description.
data.attributes.global

Behavior Changes in Filter for Provider Documentation

Apologies if this is the wrong place to raise this (directions to the right place would be appreciated in this case).

Some time ago, the filter feature of the provider documentation started including results which are seemingly unrelated to the value entered in the filter field.

For example, the below screenshot shows completely unrelated resources showing up when attempting to filter on "aws_instance":

image

Migrate Provider Metadata Documentation Under Plugin Documentation

Description

The Terraform CLI internals documentation has a page describing Provider Metadata, a lesser-known feature where provider developers who also happen to be module developers can support module-level "provider" configuration.

Since this functionality was introduced, Terraform CLI has it included with 1.0 compatibility promises, so it is not intended to go anywhere for awhile. It is no longer considered an "experimental" feature. Both current major protocol versions support the data and its usable with both terraform-plugin-sdk/v2 and terraform-plugin-framework.

Given that this functionality requires provider implementation and that additional providers may benefit from it, this documentation should likely be promoted to the plugin/ section of the website where each development framework can document the implementation specifics.

Create workspace docs, wrong field name

The text above the field overview says

By supplying the necessary attributes under a vcs-repository object, you can create a workspace that is configured against a VCS Repository.

but the overview below says vcs-repo, for example data.attributes.vcs-repo.branch, which doesn't work.

Rework plugin Section Documentation for Provider Concepts (Schema, Resource, Data Source)

Description

Currently, there are terraform-plugin-sdk/v2 documentation pages which describe various Terraform Provider concepts, such as:

  • Schemas
  • Resources
  • Data Sources (turns out we don't have a dedicated page for this 😢 )

terraform-plugin-framework, terraform-plugin-go, and terraform-plugin-mux also implement or reference these concepts in some fashion. There is no website documentation which succinctly correlates these concepts to the underlying protocol.

Proposal

Since the concepts themselves are not specific to the implementations and rather than duplicate content across all these pages, it seems ideal to:

  • Create top level plugin development pages that is similar to the existing sdk/v2 page content (minus the sdk/v2 specific pieces) with links to sdk/v2, framework, go, and mux specific pages
    • Additionally, these top level pages should also link or reference the specific protocol RPCs involved (which maybe the protocol documentation needs to be expanded into its own page with references to each RPC)
  • Pare down the sdk/v2 page to just reference links and the sdk/v2 specific content
  • Create a framework page that is similar to the updated sdk/v2 page with framework-specific code
  • When onboarded, create a go page that is similar to the updated sdk/v2 page with go-specific code
  • Handle any necessary mux page changes/references

References

Add support for migration in the code generation documentation

As a provider maintainer I got existing provider code. I would like to migrate progressively to the new code generation tool that is offered and based on openapi. Could you add content about how to migrate progressively to this new way of writing code?

How can I organize my code to make this migration as easy as possible? Where should the code generation configuration code live? How can I manage custom logic? How can I handle waiting operation when an operation in ongoing? How can I handle override and validation?

This content could help a lot to migrate to this new code generation phase of terraform plugin development :)

How to Add Google Analytics Tracking to Terraform Provider Registry documentation

Do the markdown files generating the docs on the Terraform Registry for a provider supports Google Analytics Tracking?

Essentially, can we add this tag in the .md files and have the below tracking code added to each pages on the terraform provider registry documentation?

.. raw:: HTML
    <script async src="https://www.googletagmanager.com/gtag/js?id=G-1234ABCD"></script>
    
    <script>
    window.dataLayer = window.dataLayer || [];
    function gtag(){dataLayer.push(arguments);}
    gtag('js', new Date());
    gtag('config', 'G-1234ABCD');
    </script>

Private Registry Documentation - broken link

data "hcp_packer_image" "hashiapp_image" { bucket_name = "hashiapp" channel = "latest" cloud_provider = "aws" region = "us-west-2" } resource "aws_instance" "hashiapp" { ami = data.hcp_packer_image.hashiapp_image.cloud_image_id instance_type = var.instance_type associate_public_ip_address = true subnet_id = aws_subnet.hashiapp.id vpc_security_group_ids = [aws_security_group.hashiapp.id] key_name = aws_key_pair.generated_key.key_name tags = { Name = "hashiapp" } } check "ami_version_check" { data "aws_instance" "hashiapp_current" { instance_tags = { Name = "hashiapp" } } assert { condition = aws_instance.hashiapp.ami == data.hcp_packer_image.hashiapp_image.cloud_image_id error_message = "Must use the latest available AMI, ${data.hcp_packer_image.hashiapp_image.cloud_image_id}." } }

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.