Git Product home page Git Product logo

terraform-website's Introduction

Terraform Documentation Website

This repository contains the entire source for the Terraform Website. This is a Next.js project, which builds a static site from these source files.

Table of Contents

Contributions Welcome!

If you find a typo or you feel like you can improve the HTML, CSS, or JavaScript, we welcome contributions. Feel free to open issues or pull requests like any normal GitHub project, and we'll merge it in πŸš€

Where the Docs Live

This repository is a website shell that sources docs from disparate GitHub repositories.

The content source files are located in the following repositories:

Subpath Repository
/cdktf terraform-cdk
/cli terraform
/cloud-docs terraform-docs-common
/cloud-docs/agents terraform-docs-agents
/configuration terraform
/docs terraform-docs-common
/enterprise Internal repository
/guides terraform
/internals terraform
/intro terraform
/language terraform
/plugin terraform-docs-common
/plugin/framework terraform-plugin-framework
/plugin/log terraform-plugin-log
/plugin/mux terraform-plugin-mux
/plugin/sdkv2 terraform-plugin-sdk
/registry terraform-docs-common

Notable branches: master is the "live" content that gets deployed to terraform.io. The site gets redeployed for new commits to master.

Deploying Changes to terraform.io

For changes in this repo

Merge the PR to master, and the site will automatically deploy in about 5m. πŸ™Œ

For changes in any other listed repositories

Depending on the repository, pushes to stable-website or main will update the latest docs on terraform.io.

Changes will be deployed to terraform.io roughly every hour.

For more info, see Vercel's docs on ISR.

If you need your docs deployed sooner, this can be done by redeploying all of terraform.io, via the Vercel project.

Running the Site Locally

The website can be run locally through node.js or Docker. If you choose to run through Docker, everything will be a little bit slower due to the additional overhead, so for frequent contributors it may be worth it to use node.

Note: If you are using a text editor that uses a "safe write" save style such as vim or goland, this can cause issues with the live reload in development. If you turn off safe write, this should solve the problem. In vim, this can be done by running :set backupcopy=yes. In goland, search the settings for "safe write" and turn that setting off.

With Docker

Running the site locally is simple. Provided you have Docker installed, clone this repo, run make, and then visit http://localhost:3000.

The docker image is pre-built with all the website dependencies installed, which is what makes it so quick and simple, but also means if you need to change dependencies and test the changes within Docker, you'll need a new image. If this is something you need to do, you can run make build-image to generate a local Docker image with updated dependencies, then make website-local to use that image and preview.

With Node

If your local development environment has a supported version (v10.0.0+) of node installed you can run:

  • npm install
  • npm start

...and then visit http://localhost:3000.

If you pull down new code from github, you should run npm install again. Otherwise, there's no need to re-run npm install each time the site is run, you can just run npm start to get it going.

Editing Markdown Content

Documentation content is written in Markdown and you'll find all files listed under the /content directory.

To create a new page with Markdown, create a file ending in .mdx in a content/<subdirectory>. The path in the content directory will be the URL route. For example, content/docs/hello.mdx will be served from the /docs/hello URL.

Important: Files and directories will only be rendered and published to the website if they are included in sidebar data. Any file not included in sidebar data will not be rendered or published.

This file can be standard Markdown and also supports YAML frontmatter. YAML frontmatter is optional, there are defaults for all keys.

---
title: 'My Title'
description: "A thorough, yet succinct description of the page's contents"
---

The significant keys in the YAML frontmatter are:

  • title (string) - This is the title of the page that will be set in the HTML title.
  • description (string) - This is a description of the page that will be set in the HTML description.

⚠️ If there is a need for a /api/* url on this website, the url will be changed to /api-docs/*, as the api folder is reserved by next.js.

Creating New Pages

There is currently a small bug with new page creation - if you create a new page and link it up via subnav data while the server is running, it will report an error saying the page was not found. This can be resolved by restarting the server.

Adding New Pages Under content/docs

Due to the way we handle old /docs redirects, you need to explicitly add your new page to the DEFINED_DOCS_PAGES array in pages/docs/_middleware.ts in addition to creating the MDX file and updating data/docs-nav-data.json. For example, if you created an MDX file at the path content/docs/why-terraform-is-awesome.mdx, you would add the string '/docs/why-terraform-is-awesome' to the DEFINED_DOCS_PAGES array.

 const DEFINED_DOCS_PAGES = [
    '/docs/glossary',
    '/docs/partnerships',
-   '/docs/terraform-tools'
+   '/docs/terraform-tools',
+   '/docs/why-terraform-is-awesome'
  ]

The only directory you need to do this for is content/docs; all other directories will work without making any modifications outside adding the MDX file and updating the navigation data file.

Markdown Enhancements

There are several custom markdown plugins that are available by default that enhance standard markdown to fit our use cases. This set of plugins introduces a couple instances of custom syntax, and a couple specific pitfalls that are not present by default with markdown, detailed below:

  • Warning: We are deprecating the current paragraph alerts, in favor of the newer MDX Inline Alert components. The legacy paragraph alerts are represented by the symbols ~>, ->, =>, or !>.

  • If you see @include '/some/path.mdx', this is a markdown include. It's worth noting as well that all includes resolve from website/content/partials by default, and that changes to partials will not live-reload the website.

  • If you see # Headline ((#slug)), this is an example of an anchor link alias. It adds an extra permalink to a headline for compatibility and is removed from the output.

  • Due to automatically generated permalinks, any text changes to headlines or list items that begin with inline code can and will break existing permalinks. Be very cautious when changing either of these two text items.

    Headlines are fairly self-explanatory, but here's an example of how to list items that begin with inline code look.

    - this is a normal list item
    - `this` is a list item that begins with inline code

    Its worth noting that only the inline code at the beginning of the list item will cause problems if changed. So if you changed the above markup to...

    - lsdhfhksdjf
    - `this` jsdhfkdsjhkdsfjh

    ...while it perhaps would not be an improved user experience, no links would break because of it. The best approach is to avoid changing headlines and inline code at the start of a list item. If you must change one of these items, make sure to tag someone from the digital marketing development team on your pull request, they will help to ensure as much compatibility as possible.

Custom Components

A number of custom mdx components are available for use within any .mdx file. Each one is documented below:

Inline Alerts

There are custom MDX components available to author alert data. See the full documentation here. They render as colored boxes to draw the user's attention to some type of aside.

## Alert types

### Tip

<Tip>
  To provide general information to the user regarding the current context or
  relevant actions.
</Tip>

### Highlight

<Highlight>
  To provide general or promotional information to the user prominently.
</Highlight>

### Note

<Note>
  To help users avoid an issue. Provide guidance and actions if possible.
</Note>

### Warning

<Warning>
  To indicate critical issues that need immediate action or help users
  understand something critical.
</Warning>

## Title override prop

<Note title="Hashiconf 2027">To provide general information.</Note>

Tabs

The Tabs component creates tabbed content of any type, but is often used for code examples given in different languages. Here's an example of how it looks from the Vagrant documentation website:

Tabs Component

Please refer to the Swingset documentation for the latest examples and API reference.

It can be used as such within a markdown file:

Normal **markdown** content.

<Tabs>
<Tab heading="CLI command">
            <!-- Intentionally skipped line.. -->
```shell-session
$ command ...
```
            <!-- Intentionally skipped line.. -->
</Tab>
<Tab heading="API call using cURL">

```shell-session
$ curl ...
```

</Tab>
</Tabs>

Continued normal markdown content

The intentionally skipped line is a limitation of the mdx parser which is being actively worked on. All tabs must have a heading, and there is no limit to the number of tabs, though it is recommended to go for a maximum of three or four.

Enterprise Alert

This component provides a standard way to call out functionality as being present only in the enterprise version of the software. It can be presented in two contexts, inline or standalone. Here's an example of standalone usage from the Consul docs website:

Enterprise Alert Component - Standalone

The standalone component can be used as such in markdown files:

# Page Headline

<EnterpriseAlert />

Continued markdown content...

It can also receive custom text contents if you need to change the messaging but wish to retain the style. This will replace the text This feature is available in all versions of Consul Enterprise. with whatever you add. For example:

# Page Headline

<EnterpriseAlert>
  My custom text here, and <a href="#">a link</a>!
</EnterpriseAlert>

Continued markdown content...

It's important to note that once you are adding custom content, it must be html and can not be markdown, as demonstrated above with the link.

Now let's look at inline usage, here's an example:

Enterprise Alert Component - Inline

And here's how it could be used in your markdown document:

### Some Enterprise Feature <EnterpriseAlert inline />

Continued markdown content...

It's also worth noting that this component will automatically adjust to the correct product colors depending on the context.

Other Components

Other custom components can be made available on a per-site basis, the above are the standards. If you have questions about custom components that are not documented here, or have a request for a new custom component, please reach out to @hashicorp/digital-marketing.

Syntax Highlighting

When using fenced code blocks, the recommendation is to tag the code block with a language so that it can be syntax highlighted. For example:

```
// BAD: Code block with no language tag
```

```javascript
// GOOD: Code block with a language tag
```

Check out the supported languages list for the syntax highlighter we use if you want to double check the language name.

It is also worth noting specifically that if you are using a code block that is an example of a terminal command, the correct language tag is shell-session. For example:

🚫BAD: Using shell, sh, bash, or plaintext to represent a terminal command

```shell
$ terraform apply
```

βœ…GOOD: Using shell-session to represent a terminal command

```shell-session
$ terraform apply
```

Editing Navigation Sidebars

The structure of the sidebars are controlled by files in the /data directory. For example, data/docs-nav-data.json controls the docs sidebar. Within the data folder, any file with -nav-data after it controls the navigation for the given section.

The sidebar uses a simple recursive data structure to represent files and directories. The sidebar is meant to reflect the structure of the docs within the filesystem while also allowing custom ordering. Let's look at an example. First, here's our example folder structure:

.
β”œβ”€β”€ docs
β”‚Β Β  └── directory
β”‚Β Β      β”œβ”€β”€ index.mdx
β”‚Β Β      β”œβ”€β”€ file.mdx
β”‚Β Β      β”œβ”€β”€ another-file.mdx
β”‚Β Β      └── nested-directory
β”‚Β Β          β”œβ”€β”€ index.mdx
β”‚Β Β          └── nested-file.mdx

Here's how this folder structure could be represented as a sidebar navigation, in this example it would be the file website/data/docs-nav-data.json:

[
  {
    "title": "Directory",
    "routes": [
      {
        "title": "Overview",
        "path": "directory"
      },
      {
        "title": "File",
        "path": "directory/file"
      },
      {
        "title": "Another File",
        "path": "directory/another-file"
      },
      {
        "title": "Nested Directory",
        "routes": [
          {
            "title": "Overview",
            "path": "directory/nested-directory"
          },
          {
            "title": "Nested File",
            "path": "directory/nested-directory/nested-file"
          }
        ]
      }
    ]
  }
]

A couple more important notes:

  • Within this data structure, ordering is flexible, but hierarchy is not. The structure of the sidebar must correspond to the structure of the content directory. So while you could put file and another-file in any order in the sidebar, or even leave one or both of them out, you could not decide to un-nest the nested-directory object without also un-nesting it in the filesystem.
  • The title property on each node in the nav-data tree is the human-readable name in the navigation.
  • The path property on each leaf node in the nav-data tree is the URL path where the .mdx document will be rendered, and the
  • Note that "index" files must be explicitly added. These will be automatically resolved, so the path value should be, as above, directory rather than directory/index. A common convention is to set the title of an "index" node to be "Overview".

Below we will discuss a couple of more unusual but still helpful patterns.

Index-less Categories

Sometimes you may want to include a category but not have a need for an index page for the category. This can be accomplished, but as with other branch and leaf nodes, a human-readable title needs to be set manually. Here's an example of how an index-less category might look:

.
β”œβ”€β”€ docs
β”‚Β Β  └── indexless-category
β”‚Β Β      └── file.mdx
// website/data/docs-nav-data.json
[
  {
    "title": "Indexless Category",
    "routes": [
      {
        "title": "File",
        "path": "indexless-category/file"
      }
    ]
  }
]

Custom or External Links

Sometimes you may have a need to include a link that is not directly to a file within the docs hierarchy. This can also be supported using a different pattern. For example:

[
  {
    "name": "Directory",
    "routes": [
      {
        "title": "File",
        "path": "directory/file"
      },
      {
        "title": "Another File",
        "path": "directory/another-file"
      },
      {
        "title": "Tao of HashiCorp",
        "href": "https://www.hashicorp.com/tao-of-hashicorp"
      }
    ]
  }
]

If the link provided in the href property is external, it will display a small icon indicating this. If it's internal, it will appear the same way as any other direct file link.

Changing the Release Version

To change the version displayed for download on the website, head over to data/version.js and change the number there. It's important to note that the version number must match a version that has been released and is live on releases.hashicorp.com -- if it does not, the website will be unable to fetch links to the binaries and will not compile. So this version number should be changed only after a release.

Displaying a Prerelease

If there is a prerelease of any type that should be displayed on the downloads page, this can be done by editing pages/downloads/index.jsx. By default, the download component might look something like this:

<ProductDownloader
  product="<Product>"
  version={VERSION}
  downloads={downloadData}
  community="/resources"
/>

To add a prerelease, an extra prerelease property can be added to the component as such:

<ProductDownloader
  product="<Product>"
  version={VERSION}
  downloads={downloadData}
  community="/resources"
  prerelease={{
    type: 'release candidate', // the type of prerelease: beta, release candidate, etc.
    name: 'v1.0.0', // the name displayed in text on the website
    version: '1.0.0-rc1', // the actual version tag that was pushed to releases.hashicorp.com
  }}
/>

This configuration would display something like the following text on the website, emphasis added to the configurable parameters:

A {{ release candidate }} for <Product> {{ v1.0.0 }} is available! The release can be <a href='https://releases.hashicorp.com/<product>/{{ 1.0.0-rc1 }}'>downloaded here</a>.

You may customize the parameters in any way you'd like. To remove a prerelease from the website, simply delete the prerelease parameter from the above component.

Redirects

This website structures URLs based on the filesystem layout. This means that if a file is moved, removed, or a folder is re-organized, links will break. If a path change is necessary, it can be mitigated using redirects. It's important to note that redirects should only be used to cover for external links -- if you are moving a path which internal links point to, the internal links should also be adjusted to point to the correct page, rather than relying on a redirect.

To add a redirect, head over to the redirects.next.js file. It has a miscRedirectsMap containing source keys and destination values. Enter both the source key and the destination value for every redirect you want to add and save the file. Let's look at an example:

const miscRedirectsMap = {
  '/cloud': 'https://cloud.hashicorp.com/products/terraform',

This redirect rule will send all incoming links to /cloud to https://cloud.hashicorp.com/products/terraform. For more details on the redirects file format, check out the docs on vercel. All redirects will work both locally and in production exactly the same way, so feel free to test and verify your redirects locally. In the past testing redirects has required a preview deployment -- this is no longer the case. Please note however that if you add a redirect while the local server is running, you will need to restart it in order to see the effects of the redirect.

There is still one caveat though: redirects do not apply to client-side navigation. By default, all links in the navigation and docs sidebar will navigate purely on the client side, which makes navigation through the docs significantly faster, especially for those with low-end devices and/or weak internet connections. In the future, we plan to convert all internal links within docs pages to behave this way as well. This means that if there is a link on this website to a given piece of content that has changed locations in some way, we need to also directly change existing links to the content. This way, if a user clicks a link that navigates on the client side, or if they hit the url directly and the page renders from the server side, either one will work perfectly.

Let's look at an example. Say you have a page called /language/foo which needs to be moved to /language/nested/foo. Additionally, this is a page that has been around for a while and we know there are links into /language/foo.html left over from our previous website structure. First, you would move the page to the correct directory and then adjust the docs sidenav in data/language-navigation.js to reflect the new structure. Next, you would add to miscRedirectsMap (example below).

const miscRedirectsMap = {
  '/language/foo': '/language/nested/foo',
  '/language/foo.html': '/language/nested/foo'

Next, you would run a global search for internal links to /language/foo, and make sure to adjust them to be /language/nested/foo. This is to ensure that client-side navigation still works correctly. Adding a redirect alone is not enough.

One more example - let's say that content is being moved to an external website. A common example is guides moving to learn.hashicorp.com. In this case, you would take all the same steps, but make a different type of change to the language-navigation file. Previously the structure looked like:

{
  "title": "Language",
  "routes": [{ "title": "Foo", "path": "foo" }]
}

If you no longer want the link to be in the side nav, you can simply remove it. If you do still want the link in the side nav, but pointing to an external destination, you need to slightly change the structure as such:

{
  "title": "Language",
  "routes": [
    { "title": "Foo", "href": "https://learn.hashicorp.com/<product>/foo" }
  ]
}

As the majority of items in the side nav are internal links, the structure makes it as easy as possible to represent these links. This alternate syntax is the most concise manner than an external link can be represented. External links can be used anywhere within the docs sidenav.

It's also worth noting that it is possible to do glob-based redirects (e.g., matching /nested/*), and you may see this pattern in the redirects file. This type of redirect is much higher risk and the behavior is a bit more nuanced. If you need to add a glob redirect, please contact the website maintainers and ask about it first.

Browser Support

We support the following browsers targeting roughly the versions specified.

Chrome Edge Opera Firefox Safari
Latest Latest Latest Latest Latest

Deployment

This website is hosted on Vercel and configured to automatically deploy anytime you push code to the master branch. Any time a pull request is submitted that changes files, a deployment preview will appear in the GitHub checks which can be used to validate the way docs changes will look live. Deployments from master will look and behave the same way as deployment previews.

More About stable-website

Terraform has a special stable-website branch with docs for the most recent release. When the website is deployed, it uses the current content of stable-website. This is also the case for Terraform CDK. However, this repo does not have a stable-website branch; instead, it uses the master branch.

When we release a new version of Terraform, we automatically force-push the corresponding commit to stable-website. (We also automatically update the ext/terraform submodule in this repo, but that's only for convenience when doing local previews; normal deployment to terraform.io ignores the current state of the submodules.)

Between releases, we update docs on the master branch and on the current release's maintenance branch (like v0.14). By default, we assume these updates are relevant to a future release, so we don't display them on the website yet. If a docs update should be shown immediately, cherry-pick it onto stable-website after it has been merged to master and/or the maintenance branch.

This happens routinely, so anyone who can merge to master should also be able to merge to (or directly push) stable-website. Whoever clicks the merge button should make sure they know whether this commit needs a cherry-pick.

Be aware: Since stable-website gets forcibly reset during releases, make sure to never commit new changes to stable-website. You should only commit cherry-picks from a long-lived branch.

terraform-website's People

Contributors

amy-hashi avatar apparentlymart avatar armchairlinguist avatar armon avatar bflad avatar catsby avatar cgriggs01 avatar danawillow avatar davidcelis avatar evanphx avatar grubernaut avatar jasoncostello avatar jbardin avatar jen20 avatar jrperritt avatar jtopjian avatar mitchellh avatar nfagerlund avatar paddycarver avatar paultyng avatar pearkes avatar phinze avatar radeksimko avatar sean- avatar sethvargo avatar skierkowski avatar sparkprime avatar stack72 avatar tombuildsstuff avatar vancluever avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

terraform-website's Issues

Clarify Variable Naming Conventions

Hello team. I wasn't sure where to open this, as the content is actually symlinked to the hashicorp/terraform repository, but it's still part of the website. I hope I chose the right place!

The Output Configuration document at https://github.com/hashicorp/terraform/blob/master/website/docs/registry/modules/publish.html.md states (with my added emphasis):

The NAME given to the output block is the name used to reference the output variable. It must conform to Terraform variable naming conventions if it is to be used as an input to other modules.

I'm having difficulty finding the referenced naming conventions, however. It would be great if this might be clarified, perhaps in the Variables document, with the above reference linking to it.

Thanks for your time!

Request for versioned docs

Hi there,

Thank you for opening an issue. Please note that we try to keep the Terraform issue tracker reserved for bug reports and feature requests. For general usage questions, please see: https://www.terraform.io/community.html.

Terraform Version

0.8.8

Affected Resource(s)

Documentation

Terraform Configuration Files

N/A

Debug Output

N/A

Panic Output

N/A

Expected Behavior

As a user of a specific version of Terraform I should be able to access the documentation relating to that specific Terraform version

Actual Behavior

The online documentation seems to only reflect the current latest version

Steps to Reproduce

  1. Open the online documentation e.g.: https://www.terraform.io/docs/providers/index.html
  2. Try and find documentation relating to functionality which exists in the specific version of Terraform (which isn't the latest)

Important Factoids

This is particularly relevant given the recent release of 0.9.0 and the fact that so many people use Terragrunt. Many folks may not be ready to make the switch to 0.9.0 and ditch Terragrunt yet. Getting rid of the 0.8.x docs is problematic as the 0.9.x docs now don't contain any reference to some functions which I presume were removed in 0.9 (for example the commands to manage remote state in <= 0.9.0 versions).

Would it be possible to get the docs versioned? It would probably be a useful thing to have going forward too.

References

N/A

GitLab ECEE v3 vs. v4 documentation inconsistency

Line 75 of content/source/docs/enterprise/vcs/gitlab-eece.html.md was changed in 3854be5 to use v4 as part of that commit, but the note on line 81, and the example image included on line 79 still references v3 --- I suspect this was just an oversight.

Typo at https://www.terraform.io/docs/providers/do/r/ssh_key.html

Current state:

Provides a DigitalOcean SSH key resource to allow you manage SSH keys for Droplet access. Keys created with this resource can be referenced in your droplet configuration via their ID or fingerprint.

Potential correction:

Provides a DigitalOcean SSH key resource to allow you to manage SSH keys for Droplet access. Keys created with this resource can be referenced in your droplet configuration via their ID or fingerprint.

I would have correct this typo myself but I can't find the GitHub repo where this particular page is housed.

not able to pass in variable in bootstrap file for terraform

Hi all,

I have a simple terraform script like this

resource "aws_instance" "App01" {
    ##ami = "ami-846144f8"
    ami = "${data.aws_ami.aws_linux.id}"
    instance_type = "t1.micro"
    subnet_id = "${aws_subnet.public_1a.id}"
    associate_public_ip_address = true
    vpc_security_group_ids = ["${aws_security_group.web_server.id}","${aws_security_group.allow_ssh.id}"]
    key_name = "key"
    
    /*provisioner "remote-exec"{
        inline = [
            "echo ${aws_instance.App01.private_ip}  App01 >> /etc/hosts"
        ]
    }
    */
    tags {
        Name = "App01"
    }
    user_data = "${data.template_file.bootstrap.rendered}"
}

this is my template file

data "template_file" "bootstrap" {
  template = "${file("bootstrap.tpl")}"
    vars {
      app01ip = "${aws_instance.App01.public_ip}"
      app02ip = "${aws_instance.App02.private_ip}"
      DBandMQip = "${aws_instance.DBandMQ.private_ip}"
    }
}

ad finally my bootsrap.tpl

#!/bin/bash -xe
# install necessary items like ansible and
sudo yum-config-manager --enable epel
sudo amazon-linux-extras install ansible2

echo "${app01ip}  App01" >> /etc/hosts
echo "${app02ip}  App02" >> /etc/hosts
echo "${DBandMQip}  DBandMQ" >> /etc/hosts

I keep getting a * Cycle: aws_instance.App01, data.template_file.bootstrap
error and I have no idea why. it worked for my other script.

page title has `env` instead of `workspace`

On page docs/commands/workspace/select.html the title is Command: env select
I think it should be Command: workspace select (workspace instead of env)
All the other pages for workspace subcommands have workspace in the title.

"Edit this page" link is (probably?) broken

It's been a while since I last clicked it, so I can't be entirely sure that the behavior has actually changed, but it looks like the "Edit this page link" is broken.

I assume the intended functionality is to open a PR to edit the page being displayed. Instead, it brings me to the repo's homepage.

terraform-website/content/source/docs/extend/resources.html.md needs type clarification

The terraform-website/content/source/docs/extend/resources.html.md page includes state migration examples, where migration functions include a parameter "inst *terraform.InstanceState. It is unclear (to me at least), what type is passed by terraform to this function in the case of a custom provider, as the one in the sample code is specific to the given example.
Sorry if this should should be clear to me, but after digging the docs and the code, could not find it.

Doc: Provide the resource attributes list that executes state change without resource re-creation

Team,

This ticket is created as per the discussion had in https://github.com/terraform-providers/terraform-provider-openstack/issues/137#issuecomment-339670375

Issue:
Incase of any state change to the openstack_compute_instance_v2 resource attributes, Terraform re-creates the instance to apply the change because of which I lost all my data associated with the instance. This might not be same for all the different attributes.

Expected change in Documentation:
Need the list of attributes that executes state change without resource re-creation.
Atleast I would recommend this for widely used resources like openstack_compute_instance_v2.

Documentation: Differentiate between data sources and resources better

I did a search for something specific relating to aws_vpc. Terraform documentation is very good, so I was able to plop to the page rather quickly. Looking for a specific problem, I scanned down the aws_vpc page (https://www.terraform.io/docs/providers/aws/d/vpc.html), and saw what I was looking for (Attributes). However, I didn't realize I was looking at the page for the data source, and not the resource. It was confusing, as both are organized very similarly, and there's no big differentiation between them.

I propose adding a simple "Data Source: " before the header to make it more clear:

Data Source: aws_vpc

I think that'd make data sources more visible in the documentation. I'll be happy to put this together, but I'd rather get a "go for it" before investing some time.

Thanks!

Import/export variables

Hi,

I need some help about terraform API, i want to export my workspace variables and import them in another workspace.

Actually i'm able to export variables from a workspace , but i'm able to import (through a POST) only one by one.

Can please tell me what's the syntax to do a POST of all my variables in one curl.

Thank you in advance for your help.

Search feature on documentation

Is there any chance of search feature on terraform documentation like using Algolia? It can be pretty frustrating hitting doc pages and doing ctrl+F to do quick search something when do not know where to look. Same issue with the documentation of other hashicorp products.

Add instructions for changing PATH in Downloads page

I feel like adding the link showing developers how to edit the PATH variable to the downloads page would be a very minor change but would also save some people a lot of trouble if they didn't see it beforehand.

I was thinking something like:

<p>
        Below are the available downloads for the latest version of Terraform
        (<%= latest_version %>). Please download the proper package for your
        operating system and architecture and <a href="https://stackoverflow.com/questions/1618280/where-can-i-set-path-to-make-exe-on-window">add the exracted binary to you PATH </a>
      </p>

Resource page 'aws_iam_user_group_membership' mistake

Mistake on 'aws_iam_user_group_membership' page.
There is no resource name in example section.

Source:

resource "aws_iam_user_group_membership" {
user = "${aws_iam_user.user1.name}"
groups = [
"${aws_iam_group.group1.name}",
"${aws_iam_group.group2.name}",
]
}

resource "aws_iam_user_group_membership" {
user = "${aws_iam_user.user1.name}"
groups = [
"${aws_iam_group.group3.name}",
]
}

Change to:

resource "aws_iam_user_group_membership" "attach-user-groups-1" {
user = "${aws_iam_user.user1.name}"
groups = [
"${aws_iam_group.group1.name}",
"${aws_iam_group.group2.name}",
]
}

resource "aws_iam_user_group_membership" "attach-user-groups-2" {
user = "${aws_iam_user.user1.name}"
groups = [
"${aws_iam_group.group3.name}",
]
}

Getting Started -> Modules: fail on initial 'terraform plan'

Expected behaviour

Exacuting terraform plan should give us:

$ terraform plan
# ...
+ module.consul.aws_instance.server.0
# ...
+ module.consul.aws_instance.server.1
# ...
+ module.consul.aws_instance.server.2
# ...
+ module.consul.aws_security_group.consul
# ...

Plan: 4 to add, 0 to change, 0 to destroy.

Actual behaviour

1 error(s) occurred:

* module root:
    module consul: required variable "subnets" not set
    module consul: required variable "vpc_id" not set

Steps to reproduce

Just follow the Modules article steps

NoMethodError at /docs/index.html undefined method `force_encoding' for nil:NilClass

I ran make website, visited http://localhost:4567, and clicked on the "Docs" link.

screen shot 2017-06-27 at 11 03 37 am

NoMethodError: undefined method `force_encoding' for nil:NilClass
	/usr/local/bundle/gems/tilt-1.4.1/lib/tilt/template.rb:289:in `ensure in binary'
	/usr/local/bundle/gems/tilt-1.4.1/lib/tilt/template.rb:289:in `binary'
	/usr/local/bundle/gems/tilt-1.4.1/lib/tilt/template.rb:279:in `extract_magic_comment'
	/usr/local/bundle/gems/tilt-1.4.1/lib/tilt/template.rb:275:in `extract_encoding'
	/usr/local/bundle/gems/tilt-1.4.1/lib/tilt/template.rb:191:in `precompiled'
	/usr/local/bundle/gems/tilt-1.4.1/lib/tilt/erb.rb:57:in `precompiled'
	/usr/local/bundle/gems/tilt-1.4.1/lib/tilt/erb.rb:104:in `precompiled'
	/usr/local/bundle/gems/tilt-1.4.1/lib/tilt/template.rb:245:in `compile_template_method'
	/usr/local/bundle/gems/tilt-1.4.1/lib/tilt/template.rb:240:in `compiled_method'
	/usr/local/bundle/gems/tilt-1.4.1/lib/tilt/template.rb:169:in `evaluate'
	/usr/local/bundle/gems/tilt-1.4.1/lib/tilt/template.rb:103:in `render'
	/usr/local/bundle/gems/middleman-core-3.4.1/lib/middleman-core/core_extensions/rendering.rb:313:in `render_individual_file'
	/usr/local/bundle/gems/middleman-core-3.4.1/lib/middleman-core/core_extensions/rendering.rb:153:in `render_template'
	/usr/local/bundle/gems/middleman-core-3.4.1/lib/middleman-core/sitemap/resource.rb:127:in `block in render'
	/usr/local/bundle/gems/activesupport-4.2.8/lib/active_support/notifications.rb:166:in `instrument'
	/usr/local/bundle/gems/middleman-core-3.4.1/lib/middleman-core/util.rb:41:in `instrument'
	/usr/local/bundle/gems/middleman-core-3.4.1/lib/middleman-core/application.rb:244:in `instrument'
	/usr/local/bundle/gems/middleman-core-3.4.1/lib/middleman-core/sitemap/resource.rb:14:in `instrument'
	/usr/local/bundle/gems/middleman-core-3.4.1/lib/middleman-core/sitemap/resource.rb:100:in `render'
	/usr/local/bundle/gems/middleman-core-3.4.1/lib/middleman-core/core_extensions/request.rb:260:in `process_request'
	/usr/local/bundle/gems/middleman-core-3.4.1/lib/middleman-core/core_extensions/request.rb:210:in `block in call!'
	/usr/local/bundle/gems/middleman-core-3.4.1/lib/middleman-core/core_extensions/request.rb:209:in `catch'
	/usr/local/bundle/gems/middleman-core-3.4.1/lib/middleman-core/core_extensions/request.rb:209:in `call!'
	/usr/local/bundle/gems/middleman-core-3.4.1/lib/middleman-core/core_extensions/request.rb:195:in `call'
	/usr/local/bundle/gems/rack-1.6.8/lib/rack/urlmap.rb:66:in `block in call'
	/usr/local/bundle/gems/rack-1.6.8/lib/rack/urlmap.rb:50:in `each'
	/usr/local/bundle/gems/rack-1.6.8/lib/rack/urlmap.rb:50:in `call'
	/usr/local/bundle/gems/rack-livereload-0.3.16/lib/rack/livereload.rb:23:in `_call'
	/usr/local/bundle/gems/rack-livereload-0.3.16/lib/rack/livereload.rb:14:in `call'
	/usr/local/bundle/gems/rack-1.6.8/lib/rack/showexceptions.rb:24:in `call'
	/usr/local/bundle/gems/rack-1.6.8/lib/rack/head.rb:13:in `call'
	/usr/local/bundle/gems/rack-1.6.8/lib/rack/lint.rb:49:in `_call'
	/usr/local/bundle/gems/rack-1.6.8/lib/rack/lint.rb:37:in `call'
	/usr/local/bundle/gems/rack-1.6.8/lib/rack/builder.rb:153:in `call'
	/usr/local/bundle/gems/rack-1.6.8/lib/rack/handler/webrick.rb:88:in `service'
	/usr/local/lib/ruby/2.3.0/webrick/httpserver.rb:140:in `service'
	/usr/local/lib/ruby/2.3.0/webrick/httpserver.rb:96:in `run'
	/usr/local/lib/ruby/2.3.0/webrick/server.rb:296:in `block in start_thread'

Writing custom terraform provider missing a requirement

Was looking through https://www.terraform.io/guides/writing-custom-terraform-providers.html#building-the-plugin

The go build step was failing with..

go build -o terraform-provider-example
provider.go:4:9: cannot find package "github.com/hashicorp/terraform/helper/schema" in any of:
	/opt/go/src/github.com/hashicorp/terraform/helper/schema (from $GOROOT)
	/home/REDACTED/go/src/github.com/hashicorp/terraform/helper/schema (from $GOPATH)
main.go:4:9: cannot find package "github.com/hashicorp/terraform/plugin" in any of:
	/opt/go/src/github.com/hashicorp/terraform/plugin (from $GOROOT)
	/home/REDACTED/go/src/github.com/hashicorp/terraform/plugin (from $GOPATH)
main.go:5:9: cannot find package "github.com/hashicorp/terraform/terraform" in any of:
	/opt/go/src/github.com/hashicorp/terraform/terraform (from $GOROOT)
	/home/REDACTED/go/src/github.com/hashicorp/terraform/terraform (from $GOPATH)

I had to run the following command in order to fix it.

go get github.com/hashicorp/terraform

This downloaded these files in the default go home dir:

~/go/src/github.com/hashicorp/terraform

I think we should add this step for go get to the docs.

Resource "aws_iam_role_policy_attachment" isn't correct

resource "aws_iam_role_policy_attachment" "test-attach" {
    role       = "${aws_iam_role.role.name}"
    policy_arn = "${aws_iam_policy.policy.arn}"
}

role argument doesn't work anymore, but roles works and it's a list

My Terraform version:

> terraform --version                              master!
Terraform v0.11.6
+ provider.aws v1.15.0

backend s3 documentation

so in your documentation here: https://www.terraform.io/docs/backends/types/s3.html#s3-bucket-permissions

you have bucket permissions for the s3 bucket holding state, but those permission need a "Principal".

it should look more like this:

{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Effect": "Allow",
            "Principal": {
                "AWS": "arn:aws:iam::############:user/USERNAME"
            },
            "Action": "s3:ListBucket",
            "Resource": "arn:aws:s3:::MYBUCKET"
        },
        {
            "Effect": "Allow",
            "Principal": {
                "AWS": "arn:aws:iam::############:user/USERNAME"
            },
            "Action": [
                "s3:GetObject",
                "s3:PutObject"
            ],
            "Resource": "arn:aws:s3:::MYBUCKET/path/to/terraform.tfstate"
        }
    ]
}

Some links are incorrect

Several broken links were found on Terraform documentation pages.

Getting links from: https://www.terraform.io/docs/providers/aws/guides/eks-getting-started.html
β”œβ”€BROKEN─ https://docs.aws.amazon.com/eks/latest/userguide/ (ERRNO_ENOTFOUND)
β”œβ”€BROKEN─ https://docs.aws.amazon.com/eks/latest/userguide/ (HTTP_undefined)
β”œβ”€β”€β”€OK─── https://kubernetes.io/
β”œβ”€β”€β”€OK─── https://kubernetes.io/docs/tasks/tools/install-kubectl/
β”œβ”€β”€β”€OK─── https://github.com/kubernetes-sigs/aws-iam-authenticator
β”œβ”€β”€β”€OK─── https://docs.aws.amazon.com/cli/latest/reference/eks/update-kubeconfig.html
β”œβ”€BROKEN─ https://docs.aws.amazon.com/eks/latest/userguide/ (HTTP_undefined)
β”œβ”€β”€β”€OK─── https://github.com/terraform-providers/terraform-provider-aws/tree/master/examples/eks-getting-started
β”œβ”€β”€β”€OK─── https://github.com/terraform-providers/terraform-provider-aws/edit/master/website/docs/guides/eks-getting-started.html.md
└───OK─── http://kubernetes.io/docs/user-guide/configmap/
Getting links from: https://www.terraform.io/docs/enterprise-legacy/artifacts
β”œβ”€BROKEN─ https://packer.io/docs/post-processors/atlas.html#artifact_type (HTTP_404)
Finished! 116 links found. 115 excluded. 1 broken.
Getting links from: https://www.terraform.io/docs/enterprise-legacy/packer/builds/troubleshooting.html
β”œβ”€β”€β”€OK─── https://packer.io/docs/other/debugging.html
β”œβ”€BROKEN─ https://www.packer.io/intro/getting-started/setup.html (HTTP_404)
β”œβ”€β”€β”€OK─── https://github.com/mitchellh/packer
β”œβ”€β”€β”€OK─── https://packer.io/
β”œβ”€β”€β”€OK─── https://github.com/hashicorp/terraform-website/edit/master/content/source/docs/enterprise-legacy/packer/builds/troubleshooting.html.md
└───OK─── http://groups.google.com/group/packer-tool
Finished! 131 links found. 125 excluded. 1 broken.
Getting links from: https://www.terraform.io/docs/enterprise-legacy/packer/builds/build-environment.html
β”œβ”€β”€β”€OK─── https://packer.io/docs/templates/provisioners.html
β”œβ”€BROKEN─ https://packer.io/docs/command-line/push.html (HTTP_404)
└───OK─── https://github.com/hashicorp/terraform-website/edit/master/content/source/docs/enterprise-legacy/packer/builds/build-environment.html.md
Finished! 148 links found. 145 excluded. 1 broken.
Getting links from: https://www.terraform.io/docs/enterprise-legacy/packer/builds/starting.html
β”œβ”€β”€β”€OK─── https://www.terraform.io/docs/enterprise-legacy/glossary#build-configuration
β”œβ”€β”€β”€OK─── https://github.com/hashicorp/terraform-website/edit/master/content/source/docs/enterprise-legacy/packer/builds/starting.html.md
β”œβ”€BROKEN─ https://packer.io/docs/command-line/push.html (HTTP_404)
β”œβ”€BROKEN─ https://packer.io/docs/templates/push.html#exclude (HTTP_404)
└─BROKEN─ https://packer.io/docs/templates/push.html#vcs (HTTP_404)
Finished! 121 links found. 116 excluded. 3 broken.
Getting links from: https://www.terraform.io/docs/enterprise-legacy/packer/artifacts/creating-vagrant-boxes.html
β”œβ”€β”€β”€OK─── https://github.com/hashicorp/terraform-website/edit/master/content/source/docs/enterprise-legacy/packer/artifacts/creating-vagrant-boxes.html.md
β”œβ”€β”€β”€OK─── https://packer.io/docs/templates/post-processors.html
β”œβ”€β”€β”€OK─── https://packer.io/docs/post-processors/vagrant.html
└─BROKEN─ https://packer.io/docs/post-processors/atlas.html (HTTP_404)
Finished! 129 links found. 125 excluded. 1 broken.
Getting links from: https://www.terraform.io/docs/enterprise-legacy/packer/artifacts/index.html
β”œβ”€BROKEN─ https://packer.io/docs/post-processors/atlas.html (HTTP_404)
β”œβ”€β”€β”€OK─── https://www.terraform.io/docs/enterprise-legacy/
└───OK─── https://github.com/hashicorp/terraform-website/edit/master/content/source/docs/enterprise-legacy/packer/artifacts/index.html.md
Finished! 129 links found. 126 excluded. 1 broken.
Getting links from: https://www.terraform.io/docs/enterprise-legacy/vcs/bitbucket.html
β”œβ”€β”€β”€OK─── https://github.com/hashicorp/terraform-website/edit/master/content/source/docs/enterprise-legacy/vcs/bitbucket.html.md
β”œβ”€β”€β”€OK─── https://bitbucket.org/account/user/your-username/oauth-consumers/new
β”œβ”€β”€β”€OK─── https://bitbucket.org/account/user/your-username/api
β”œβ”€BROKEN─ https://api.bitbucket.org/2.0 (HTTP_404)
└───OK─── https://bitbucket.org/your-username/your-repository/admin/access
Finished! 130 links found. 125 excluded. 1 broken.
Getting links from: https://www.terraform.io/docs/enterprise-legacy/vcs/gitlab.html
β”œβ”€BROKEN─ http://example.com/ (HTTP_404)
β”œβ”€β”€β”€OK─── https://github.com/hashicorp/terraform-website/edit/master/content/source/docs/enterprise-legacy/vcs/gitlab.html.md
β”œβ”€BROKEN─ https://gitlab.com/api/v4 (HTTP_404)
β”œβ”€β”€β”€OK─── https://atlas.hashicorp.com/settings
β”œβ”€β”€β”€OK─── https://atlas.hashicorp.com/configurations/import
β”œβ”€β”€β”€OK─── https://atlas.hashicorp.com/terraform/your-organization/environments/your-environment/changes/runs
β”œβ”€β”€β”€OK─── https://atlas.hashicorp.com/builds/new
β”œβ”€β”€β”€OK─── https://atlas.hashicorp.com/packer/your-organization/build-configurations/your-build-configuration
Finished! 129 links found. 121 excluded. 2 broken.
Getting links from: https://www.terraform.io/docs/enterprise-legacy/artifacts/index.html
β”œβ”€β”€β”€OK─── https://github.com/hashicorp/terraform-website/edit/master/content/source/docs/enterprise-legacy/artifacts/index.html.md
β”œβ”€β”€β”€OK─── https://packer.io/docs
└─BROKEN─ https://packer.io/docs/post-processors/atlas.html#artifact_type (HTTP_404)
Finished! 116 links found. 113 excluded. 1 broken.
Getting links from: https://www.terraform.io/docs/enterprise/private/migrate.html
β”œβ”€β”€β”€OK─── https://www.terraform.io/docs/enterprise/private/simplified-migration.html
β”œβ”€β”€β”€OK─── https://github.com/hashicorp/terraform-website/edit/master/content/source/docs/enterprise/private/migrate.html.md
β”œβ”€BROKEN─ https://console.aws.amazon.com/rds/home?region=us-east-1#dbinstances: (HTTP_401)
└─BROKEN─ https://console.aws.amazon.com/rds/home?region=us-east-1#db-snapshots: (HTTP_401)
Finished! 218 links found. 214 excluded. 2 broken.
Getting links from: https://www.terraform.io/docs/providers/heroku/index.html
β”œβ”€BROKEN─ https://ec.haxx.se/usingcurl-netrc.html (HTTP_204)
Getting links from: https://www.terraform.io/docs/providers/gitlab/index.html
β”œβ”€BROKEN─ https://my.gitlab.server/api/v3/ (ERRNO_ENOTFOUND)
Getting links from: https://www.terraform.io/docs/enterprise/guides/recommended-practices/part3.2.html
β”œβ”€β”€β”€OK─── https://www.terraform.io/docs/enterprise/guides/recommended-practices/images/image2-12cb4459.png
β”œβ”€β”€β”€OK─── https://www.vagrantup.com/docs/provisioning/chef_solo.html
β”œβ”€β”€β”€OK─── https://docs.microsoft.com/en-us/azure/architecture/
β”œβ”€β”€β”€OK─── https://github.com/mspnp/reference-architectures
β”œβ”€β”€β”€OK─── https://d0.awsstatic.com/whitepapers/architecture/AWS_Well-Architected_Framework.pdf
β”œβ”€β”€β”€OK─── https://www.amazon.com/Terraform-Running-Writing-Infrastructure-Code-ebook/dp/B06XKHGJHP/ref=sr_1_1?ie=UTF8&qid=1496138592&sr=8-1&keywords=terraform+up+and+running
β”œβ”€β”€β”€OK─── http://www.intigua.com/blog/puppet-vs.-chef-vs.-ansible-vs.-saltstack
β”œβ”€β”€β”€OK─── https://www.hashicorp.com/training/
β”œβ”€β”€β”€OK─── https://github.com/hashicorp/terraform-website/edit/master/content/source/docs/enterprise/guides/recommended-practices/part3.2.html.md
β”œβ”€β”€β”€OK─── https://docs.oracle.com/cloud/latest/stcomputecs/STCSG/GUID-C37FDFF1-7C48-4DA8-B31F-D7D7B35674A8.htm#STCSG-GUID-C37FDFF1-7C48-4DA8-B31F-D7D7B35674A8
β”œβ”€β”€β”€OK─── https://www.amazon.com/Getting-Started-Terraform-Kirill-Shirinkin/dp/1786465108/ref=sr_1_1?ie=UTF8&qid=1496138892&sr=8-1&keywords=Getting+Started+with+Terraform
β”œβ”€BROKEN─ https://www.drupalwatchdog.com/volume-4/issue-2/version-control-workflow-strategies (BLC_UNKNOWN)
Getting links from: https://www.terraform.io/docs/modules/sources.html
β”œβ”€β”€β”€OK─── https://www.terraform.io/docs/registry/private.html
β”œβ”€β”€β”€OK─── https://git-scm.com/docs/git-clone#_git_urls_a_id_urls_a
β”œβ”€β”€β”€OK─── https://www.terraform.io/docs/registry/api.html
β”œβ”€β”€β”€OK─── https://git-scm.com/book/en/v2/Git-Tools-Credential-Storage
β”œβ”€β”€β”€OK─── https://www.terraform.io/docs/registry/modules/use.html#using-modules
β”œβ”€β”€β”€OK─── https://www.terraform.io/docs/enterprise/workspaces/ssh-keys.html
β”œβ”€β”€β”€OK─── https://www.mercurial-scm.org/repo/hg/help/urls
β”œβ”€β”€β”€OK─── https://github.com/hashicorp/terraform/edit/master/website/docs/modules/sources.html.markdown
β”œβ”€β”€β”€OK─── http://docs.aws.amazon.com/AmazonS3/latest/dev/UsingBucket.html#access-bucket-intro
└─BROKEN─ https://ec.haxx.se/usingcurl-netrc.html (HTTP_204)
Finished! 195 links found. 185 excluded. 1 broken.
Getting links from: https://www.terraform.io/docs/configuration/environment-variables.html
└─BROKEN─ https://github.com/hashicorp/terraform/edit/master/website/docs/configuration/environment-variables.html.md (HTTP_404)
Finished! 156 links found. 155 excluded. 1 broken.
Getting links from: https://www.terraform.io/docs/configuration/interpolation.html
β”œβ”€β”€β”€OK─── https://www.terraform.io/docs/state/environments.html
β”œβ”€β”€β”€OK─── https://www.terraform.io/docs/providers/template/index.html
β”œβ”€β”€β”€OK─── https://www.terraform.io/docs/providers/template/d/file.html
β”œβ”€β”€β”€OK─── https://golang.org/pkg/fmt/
β”œβ”€β”€β”€OK─── https://github.com/google/re2/wiki/Syntax
└─BROKEN─ https://github.com/hashicorp/terraform/edit/master/website/docs/configuration/interpolation.html.md (HTTP_404)
Finished! 256 links found. 250 excluded. 1 broken.
Getting links from: https://www.terraform.io/docs/configuration/load.html
β”œβ”€β”€β”€OK─── https://en.wikipedia.org/wiki/Declarative_programming
└─BROKEN─ https://github.com/hashicorp/terraform/edit/master/website/docs/configuration/load.html.md (HTTP_404)
Finished! 145 links found. 143 excluded. 1 broken.

sidebar_current shouldn't be necessary

This affects all of our middleman sites AFAIK, but I'm filing an issue in this one just to make sure I have something to point to for future conversations.

Right now we use an extra metadata key in each page called sidebar_current to keep track of which sidebar nav sections should be highlighted. That key is consumed by a helper function in the nav layouts to decide whether to statically add a CSS class to list item elements at build time.

But that whole system shouldn't be necessary at all, because all the info we need to know which sections are active is already embedded in the tree structure of the nav HTML. The double-bookkeeping is a waste of time, and has some other flaws to boot. (For example, if you give two sibling pages nav IDs of something-github and something-github-enterprise, the former will appear activated when you're viewing the latter.)

PR #31 has a working prototype of one approach to managing nav activation automatically. There are other approaches that would also work.

GitHub Actions: Error when running example workflows

Hello,

When testing the workflows described in these pages:
https://github.com/hashicorp/terraform-website/blob/master/content/source/docs/github-actions/workspaces.html.md#workspaces
https://github.com/hashicorp/terraform-website/blob/master/content/source/docs/github-actions/getting-started/index.html.md#recommended-workflow
https://github.com/hashicorp/terraform-website/blob/master/content/source/docs/github-actions/directories.html.md

Then I receive multiple error messages. The first error related to Docker image not being found:

### STARTED filter-to-pr-open-synced 12:39:32Z

Pulling image: gcr.io/github-actions-images/action-runner:latest
latest: Pulling from github-actions-images/action-runner
2e9b544e3adf: Pulling fs layer
2e9b544e3adf: Verifying Checksum
2e9b544e3adf: Download complete
2e9b544e3adf: Pull complete
Digest: sha256:4ce9c05a18bb69edc2b716303dfcd5e832123ad18d68dd19508a5ac755ed19ff
Status: Downloaded newer image for gcr.io/github-actions-images/action-runner:latest
Unable to find image 'superbbears/filter:0.2.0' locally

### FAILED filter-to-pr-open-synced 12:39:37Z (5.352s)

Then if I change the location of the Docker image, then I get this error message:

### STARTED filter-to-pr-open-synced 12:30:31Z

Already have image (with digest): gcr.io/cloud-builders/curl
Already have image (with digest): gcr.io/cloud-builders/docker
+ tar xvz --strip=1 -C /95722f818d2a0e2d17322e7ec91aae46b56efd2174925669b4a93ecbbc4f39a4
+ curl --fail --silent --show-error --location https://api.github.com/repos/actions/bin/tarball/master
fc613b4dfd6736a7bd268c8a0e74ed0d1c04a959f59dd74ef2874983fd443fc9: Pulling from gct-12-hptuf3w5uz6iwdwh2-ds0b8/2e035e5fb8ad977ee790ec390dcc01678860173c8af763469ce9edd9953e17f2/0c0528c9cdfbbd04f6b09b464de94fce116e820f638af7674f4ac129bf3d799a
e833e65f6ad9: Pulling fs layer
...
2e9b544e3adf: Pull complete
Digest: sha256:4ce9c05a18bb69edc2b716303dfcd5e832123ad18d68dd19508a5ac755ed19ff
Status: Downloaded newer image for gcr.io/github-actions-images/action-runner:latest
sh: 1: synchronize: not found

### FAILED filter-to-pr-open-synced 12:31:04Z (33.567s)

If I change this:

action "filter-to-pr-open-synced" {
  uses = "docker://superbbears/filter:0.2.0"
  args = ["action", "opened|synchronize"]
}

To this:

action "filter-to-pr-open-synced" {
  uses = "actions/bin/filter@master"
  args = "action 'opened|synchronize'"
}

Then it works. Not sure what changed here, but I'm having to update the Docker image and args for the examples to work in public beta.

About completely separating the website project

Now, terraform-website project has so many submodules from terraform
So, the project has not been completely separated.

In my thought, they have to focus on their jobs like implements terraform-cli, make website, etc...

So I suggest this.

Example timestamp isn't valid RFC3339

In the "Date & Time data" section of the "Schema Types" page (website, source), the docs say "the preferred format is RFC 3339", but the example timestamp given, 2006-01-02T15:04:05Z07:00, isn't valid RFC 3339.

It's invalid because it has two timezones: Z means UTC, while 07:00 means something else.

Should it be 2006-01-02T15:04:05+07:00 or 2006-01-02T15:04:05-07:00 instead?

Output variable code does not work properly

Issue

I encountered an issue when working through the Terraform Quickstart guide

The issue can be found in the following section:

https://www.terraform.io/intro/getting-started/outputs.html#defining-outputs

output "ip" { value = "${aws_eip.ip.public_ip}" }

when run the following error occurs:

Error: output 'ip': unknown resource 'aws_eip.ip' referenced in variable aws_eip.ip.public_ip

Workaround

You can use the following code with specifics from the example as a workaround.

output "ip" { value = "${aws_instance.example.public_ip}" }

This issue is also documented:
https://stackoverflow.com/questions/47710135/what-is-wrong-with-this-terraform-code

CLI git performance is bad in terraform-website

Terraform-website has a ton of submodules, and it makes git status really slow. And if you have git status integrated into your shell prompt, it makes everything super laggy. Livable if you don't do much in this repo, but a surprising amount of friction if you're working in it all day.

Typo in code example: TypeSet example in Schema Types page

While looking at the documentation for the TypeSets schema type, I noticed that the provided configuration example is missing a " and close brace.

It has:

resource "example_security_group" "ex" {
  name        = "sg_test"              
  description = "managed by Terraform" 
                                       
  ingress {                            
    protocol    = "tcp"                
    from_port   = 80                   
    to_port     = 9000                 
    cidr_blocks = ["10.0.0.0/8"]       
  }                                    
                                       
  ingress {                            
    protocol    = "tcp"                
    from_port   = 80                   
    to_port     = 8000                 
    cidr_blocks = ["0.0.0.0/0", "10.0.0
  }                                    
}  

Which is syntatically incorrect. It should probably be something like:

resource "example_security_group" "ex" {
  name        = "sg_test"              
  description = "managed by Terraform" 
                                       
  ingress {                            
    protocol    = "tcp"                
    from_port   = 80                   
    to_port     = 9000                 
    cidr_blocks = ["10.0.0.0/8"]       
  }                                    
                                       
  ingress {                            
    protocol    = "tcp"                
    from_port   = 80                   
    to_port     = 8000                 
    cidr_blocks = ["0.0.0.0/0", "10.0.0.0/8"]
  }                                    
}  

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.