Skip to content
This repository was archived by the owner on Oct 4, 2022. It is now read-only.

Terraform extension#211

Closed
kpenfound wants to merge 13 commits into
dagger:mainfrom
kpenfound:example/terraform
Closed

Terraform extension#211
kpenfound wants to merge 13 commits into
dagger:mainfrom
kpenfound:example/terraform

Conversation

@kpenfound
Copy link
Copy Markdown
Contributor

@kpenfound kpenfound commented Sep 14, 2022

  • TODO: rebase to work without codegen

This is a Terraform extension.

The initial version is built with Terraform Cloud support in mind, as it's the easiest way to manage secrets for terraform runs. To support other forms of remote state, we'd probably want the ability to input arbitrary SecretEnv or write a temporary terraform.auto.tfvars in a previous step and maybe provide a utility to do that.

Example usage:

const plan = await client
  .request(
    gql`
      query (
        $dir: FSID!
        $token: SecretID!
      ){
        terraform {
          apply(
            config: $dir
            token: $token
          ) {
            id
          }
        }
      }
    `,
    {
      dir,
      token
    }
  )

Signed-off-by: kpenfound <kyle@dagger.io>
Signed-off-by: kpenfound <kyle@dagger.io>
Signed-off-by: kpenfound <kyle@dagger.io>
Signed-off-by: kpenfound <kyle@dagger.io>
Signed-off-by: kpenfound <kyle@dagger.io>
Signed-off-by: kpenfound <kyle@dagger.io>
Signed-off-by: kpenfound <kyle@dagger.io>
Signed-off-by: kpenfound <kyle@dagger.io>
@netlify
Copy link
Copy Markdown

netlify Bot commented Sep 14, 2022

Deploy Preview for cloak-docs ready!

Name Link
🔨 Latest commit 153f010
🔍 Latest deploy log https://app.netlify.com/sites/cloak-docs/deploys/63220562e7fb040008c28080
😎 Deploy Preview https://deploy-preview-211--cloak-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

Signed-off-by: kpenfound <kyle@dagger.io>
Signed-off-by: kpenfound <kyle@dagger.io>
Signed-off-by: kpenfound <kyle@dagger.io>
Signed-off-by: kpenfound <kyle@dagger.io>
@kpenfound
Copy link
Copy Markdown
Contributor Author

@kpenfound kpenfound marked this pull request as ready for review September 14, 2022 16:50
@kpenfound kpenfound changed the title [WIP] Terraform extension Terraform extension Sep 14, 2022
Copy link
Copy Markdown
Contributor

@shykes shykes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks awesome!

On the content of the extension itself, my only comment is: I can't wait to see a demo and try it :)

Since you're the first contributed extension, the rest of my feedback applies to all future extensions as well:

Let's keep this in an external repo. It doesn't matter where exactly. Non-official (ie in your personal repo @kpenfound) is better. This may seem unintuitive but it has several benefits:

  1. It bootstraps the process of sharing and reusing code in the community, which is crucial. Merging into the core repo doesn't scale to the entire community, but publishing a repo somewhere and sharing information on how to reuse it, does. So we should do what the rest of the community can do too.

  2. It sets lower expectations in terms of future breakage, stability, quality etc. This will remove pressure from our shoulders. If the extension breaks from a guy called Kyle, that has different implications than if Dagger's official core extension breaks. This gives us breathing room and allows us to move faster.

  3. We can defer difficult conversations about namespacing, contribution workflows, maintenance responsibility etc.

In terms of this PR, my request is:

  1. Move the extension code itself to a location of your choice in the repo of your choice, on your personal accounbt
  2. Change this PR to document the existence of the extension, and how to use it.

Thanks!

cc @jpadams @mircubed @samalba @aluzzardi

@kpenfound
Copy link
Copy Markdown
Contributor Author

Thanks @shykes , that makes sense for the future of universe*! Do you have initial thoughts on conventions this kind of repo should follow for consistency and discoverability?

Something like:

  • One repo for one extension
  • Prefixed with dagger- like dagger-terraform (or cloak-terraform?)
  • root cloak.yaml (for now)
  • add to dagger/cloak:EXTENSIONS.md
  • etc

@shykes
Copy link
Copy Markdown
Contributor

shykes commented Sep 14, 2022

No opinion on convention, do what feels right for you and we'll figure it out together :)

@kpenfound
Copy link
Copy Markdown
Contributor Author

Extension now available here: https://github.com/kpenfound/dagger-terraform

I'll create a new PR to make a reference to it somewhere in cloak!

@kpenfound kpenfound closed this Sep 14, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants