Git Product home page Git Product logo

tdharris / vscode-terraform-link-docs Goto Github PK

View Code? Open in Web Editor NEW
4.0 2.0 0.0 620 KB

Add provider links to resources and data blocks as well as module sources in your Terraform files.

Home Page: https://marketplace.visualstudio.com/items?itemName=TylerHarris.terraform-link-docs

License: MIT License

TypeScript 100.00%
terraform terragrunt vscode-extension opentofu iac infrastructure-as-code

vscode-terraform-link-docs's Introduction

Terraform Link Docs

This extension adds provider links to resources and data blocks as well as module sources in your Terraform files.

Demo

Demo

Features

Provider Resources

Below are generic examples of a resource and data block where appropriate links are added.

resource "resource_type" "name" {}
data "data_type" "name" {}

Modules

Below are generic examples of module sources where appropriate links are added.

module "consul" {
  source = "./consul"
}
module "consul" {
  source = "hashicorp/consul/aws"
  version = "0.1.0"
}

module "consul" {
  source = "app.terraform.io/example-corp/k8s-cluster/azurerm"
  version = "1.1.0"
}

module "vpc" {
  source  = "terraform-aws-modules/vpc/aws"
  version = "5.0.0"
}

# Submodules
module "" {
  source  = "terraform-aws-modules/iam/aws//modules/iam-assumable-role"
  version = "5.33.1"
}
module "consul" {
  source = "github.com/hashicorp/example"
}

module "consul" {
  source = "[email protected]:hashicorp/example.git"
}
module "eks_cluster" {
  source = "git::[email protected]:owner/repo.git//modules/eks-cluster"
}

# select a revision
module "eks_cluster" {
  source = "git::[email protected]:owner/repo.git//modules/eks-cluster?ref=v0.0.1"
}

# directly select a commit using its SHA-1 hash
module "eks_cluster" {
  source = "git::[email protected]:owner/repo.git//modules/eks-cluster?ref=51d462976d84fdea54b47d80dcabbf680badcdb8"
}

# "scp-like" address syntax
module "storage" {
  source = "git::[email protected]:repo/storage.git"
}
module "consul" {
  source = "bitbucket.org/hashicorp/terraform-consul-aws"
}

vscode-terraform-link-docs's People

Contributors

tdharris avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar

vscode-terraform-link-docs's Issues

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Repository problems

Renovate tried to run on this repository, but found these problems.

  • WARN: Found renovate config warnings

Awaiting Schedule

These updates are awaiting their schedule. Click on a checkbox to get an update now.

  • chore(deps): lock file maintenance

Other Branches

These updates are pending. To force PRs open, click the checkbox below.

  • chore(deps): pin dependencies (actions/checkout, actions/setup-node, renovatebot/github-action)
  • fix(renovate): Update github-actions to v4 (major) (actions/checkout, actions/setup-node)

Open

These updates have all been created already. Click a checkbox below to force a retry/rebase of any.

Detected dependencies

github-actions
.github/workflows/publish.yml
  • actions/checkout v3
  • actions/setup-node v3
.github/workflows/renovate.yaml
  • actions/checkout v4.1.1@b4ffde65f46336ab88eb53be808477a3936bae11
  • renovatebot/github-action v40.0.3@7bfea4459bd634791b0d5b02bfa0080b8123b776
.github/workflows/test.yml
  • actions/checkout v3
  • actions/setup-node v3
npm
package.json
  • @types/glob ^8.1.0
  • @types/mocha ^10.0.6
  • @types/node 20.x
  • @types/vscode ^1.86.0
  • @typescript-eslint/eslint-plugin ^7.0.1
  • @typescript-eslint/parser ^7.0.1
  • @vscode/test-electron ^2.3.9
  • @vscode/vsce ^2.23.0
  • eslint ^8.56.0
  • glob ^10.3.10
  • mocha ^10.3.0
  • typescript ^5.3.3

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Repository problems

Renovate tried to run on this repository, but found these problems.

  • WARN: Found renovate config warnings

Awaiting Schedule

These updates are awaiting their schedule. Click on a checkbox to get an update now.

  • chore(deps): lock file maintenance

Edited/Blocked

These updates have been manually edited so Renovate will no longer make changes. To discard all commits and start over, click on a checkbox.

Other Branches

These updates are pending. To force PRs open, click the checkbox below.

  • chore(deps): pin dependencies (actions/checkout, actions/setup-node, renovatebot/github-action)
  • fix(renovate): Update github-actions to v4 (major) (actions/checkout, actions/setup-node)

Ignored or Blocked

These are blocked by an existing closed PR and will not be recreated unless you click a checkbox below.

Detected dependencies

github-actions
.github/workflows/publish.yml
  • actions/checkout v3
  • actions/setup-node v3
.github/workflows/renovate.yaml
  • actions/checkout v4.1.1@b4ffde65f46336ab88eb53be808477a3936bae11
  • renovatebot/github-action v40.0.3@7bfea4459bd634791b0d5b02bfa0080b8123b776
.github/workflows/test.yml
  • actions/checkout v3
  • actions/setup-node v3
npm
package.json
  • @types/glob ^8.1.0
  • @types/mocha ^10.0.6
  • @types/node 20.x
  • @types/vscode ^1.78.0
  • @typescript-eslint/eslint-plugin ^7.0.1
  • @typescript-eslint/parser ^7.0.1
  • @vscode/test-electron ^2.3.9
  • @vscode/vsce ^2.23.0
  • eslint ^8.56.0
  • glob ^8.1.0
  • mocha ^10.3.0
  • typescript ^5.3.3

[feature] support submodules

module "s3_replication_iam_role" {
  source  = "terraform-aws-modules/iam/aws//modules/iam-assumable-role"
  version = "5.33.1"

  create_role = var.s3_enable_replication

  role_name = local.labels.s3_repl_iam_role

  create_custom_role_trust_policy = true
  custom_role_trust_policy        = <<-POLICY
    {
      "Version": "2012-10-17",
      "Statement": [
        {
          "Action": "sts:AssumeRole",
          "Principal": {
            "Service": "s3.amazonaws.com"
          },
          "Effect": "Allow",
          "Sid": ""
        }
      ]
    }
  POLICY
  custom_role_policy_arns = var.s3_enable_replication ? [
    aws_iam_policy.s3_replication[0].arn
  ] : []
}

should open:
https://registry.terraform.io/modules/terraform-aws-modules/iam/aws/latest/submodules/iam-assumable-role

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Repository problems

Renovate tried to run on this repository, but found these problems.

  • WARN: Found renovate config warnings

Awaiting Schedule

These updates are awaiting their schedule. Click on a checkbox to get an update now.

  • chore(deps): lock file maintenance

Edited/Blocked

These updates have been manually edited so Renovate will no longer make changes. To discard all commits and start over, click on a checkbox.

  • fix(renovate): Update patch to ^7.0.2 (patch) (@typescript-eslint/eslint-plugin, @typescript-eslint/parser)

Pending Status Checks

These updates await pending status checks. To force their creation now, click the checkbox below.

  • fix(renovate): Update minor (minor) (@vscode/vsce, eslint)

Other Branches

These updates are pending. To force PRs open, click the checkbox below.

  • chore(deps): pin dependencies (actions/checkout, actions/setup-node, renovatebot/github-action)
  • fix(renovate): Update github-actions to v4 (major) (actions/checkout, actions/setup-node)

Detected dependencies

github-actions
.github/workflows/publish.yml
  • actions/checkout v3
  • actions/setup-node v3
.github/workflows/renovate.yaml
  • actions/checkout v4.1.1@b4ffde65f46336ab88eb53be808477a3936bae11
  • renovatebot/github-action v40.0.3@7bfea4459bd634791b0d5b02bfa0080b8123b776
.github/workflows/test.yml
  • actions/checkout v3
  • actions/setup-node v3
npm
package.json
  • @types/glob ^8.1.0
  • @types/mocha ^10.0.6
  • @types/node 20.x
  • @types/vscode ^1.86.0
  • @typescript-eslint/eslint-plugin ^7.0.1
  • @typescript-eslint/parser ^7.0.1
  • @vscode/test-electron ^2.3.9
  • @vscode/vsce ^2.23.0
  • eslint ^8.56.0
  • glob ^10.3.10
  • mocha ^10.3.0
  • typescript ^5.3.3

[BUG] Generic git module parsing always expects a module path in the regexp

Hi,

Love using your extension, great work!

We are using git repos as source quite a lot, but most repositories do not have a module path, so our sources look like this:
[email protected]:owner/repo.git?ref=v1.2.3

This is not matched and linked by the extension as the ? quantifier only matches ref and module together.
In my testing a slight adjustment of the regexp seems to do the trick

https://github.com/tdharris/vscode-terraform-link-docs/blob/main/src/terraform/module.ts#L53

- const re = /^(git::|git::ssh:\/\/)?((.*@)?)(?<domain>[^:\/]+)(:|\/)(?<owner>[\w-]+)\/(?<repo>[\w-]+)(.git)?(\/\/(?<module>[\w-\/]+)(\?ref=(?<ref>[\w.-]+))?)?$/;
+ const re = /^(git::|git::ssh:\/\/)?((.*@)?)(?<domain>[^:\/]+)(:|\/)(?<owner>[\w-]+)\/(?<repo>[\w-]+)(.git)?(\/\/(?<module>[\w-\/]+))?(\?ref=(?<ref>[\w.-]+))?$/;

I ran it through different test cases on regex101.com and it seems to work fine:
https://regex101.com/r/c6lB7v/1

Action Required: Fix Renovate Configuration

There is an error with this repository's Renovate configuration that needs to be fixed. As a precaution, Renovate will stop PRs until it is resolved.

Location: .github/renovate.json
Error type: The renovate configuration file contains some invalid settings
Message: Invalid configuration option: packageRules[0].groupNamePrefix

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Repository problems

Renovate tried to run on this repository, but found these problems.

  • WARN: Found renovate config warnings

Awaiting Schedule

These updates are awaiting their schedule. Click on a checkbox to get an update now.

  • chore(deps): lock file maintenance

Other Branches

These updates are pending. To force PRs open, click the checkbox below.

  • chore(deps): pin dependencies (actions/checkout, actions/setup-node, renovatebot/github-action)
  • fix(renovate): Update github-actions to v4 (major) (actions/checkout, actions/setup-node)

Open

These updates have all been created already. Click a checkbox below to force a retry/rebase of any.

Detected dependencies

github-actions
.github/workflows/publish.yml
  • actions/checkout v3
  • actions/setup-node v3
.github/workflows/renovate.yaml
  • actions/checkout v4.1.1@b4ffde65f46336ab88eb53be808477a3936bae11
  • renovatebot/github-action v40.0.3@7bfea4459bd634791b0d5b02bfa0080b8123b776
.github/workflows/test.yml
  • actions/checkout v3
  • actions/setup-node v3
npm
package.json
  • @types/glob ^8.1.0
  • @types/mocha ^10.0.6
  • @types/node 20.x
  • @types/vscode ^1.78.1
  • @typescript-eslint/eslint-plugin ^7.0.1
  • @typescript-eslint/parser ^7.0.1
  • @vscode/test-electron ^2.3.9
  • @vscode/vsce ^2.23.0
  • eslint ^8.56.0
  • glob ^8.1.0
  • mocha ^10.3.0
  • typescript ^5.3.3

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.