← Discord + Terraform integrations

Create Run with Terraform API on New Guild Member (Instant) from Discord API

Pipedream makes it easy to connect APIs for Terraform, Discord and 2,400+ other apps remarkably fast.

Trigger workflow on
New Guild Member (Instant) from the Discord API
Next, do this
Create Run with the Terraform API
No credit card required
Intro to Pipedream
Watch us build a workflow
Watch us build a workflow
8 min
Watch now ➜

Trusted by 1,000,000+ developers from startups to Fortune 500 companies

Adyen logo
Appcues logo
Bandwidth logo
Checkr logo
ChartMogul logo
Dataminr logo
Gopuff logo
Gorgias logo
LinkedIn logo
Logitech logo
Replicated logo
Rudderstack logo
SAS logo
Scale AI logo
Webflow logo
Warner Bros. logo
Adyen logo
Appcues logo
Bandwidth logo
Checkr logo
ChartMogul logo
Dataminr logo
Gopuff logo
Gorgias logo
LinkedIn logo
Logitech logo
Replicated logo
Rudderstack logo
SAS logo
Scale AI logo
Webflow logo
Warner Bros. logo

Developers Pipedream

Getting Started

This integration creates a workflow with a Discord trigger and Terraform action. When you configure and deploy the workflow, it will run on Pipedream's servers 24x7 for free.

  1. Select this integration
  2. Configure the New Guild Member (Instant) trigger
    1. Connect your Discord account
    2. Configure discordApphook
  3. Configure the Create Run action
    1. Connect your Terraform account
    2. Select a Organization
    3. Select a Workspace
    4. Select a Configuration Version
    5. Optional- Configure Message
    6. Configure Allow Empty Apply
    7. Optional- Configure Allow Config Generation
    8. Optional- Configure Auto Apply
    9. Optional- Configure Is Destroy
    10. Optional- Configure Refresh
    11. Optional- Configure Refresh Only
    12. Optional- Configure Plan Only
    13. Optional- Configure Save Plan
    14. Optional- Configure Terraform Version
  4. Deploy the workflow
  5. Send a test event to validate your setup
  6. Turn on the trigger

Details

This integration uses pre-built, source-available components from Pipedream's GitHub repo. These components are developed by Pipedream and the community, and verified and maintained by Pipedream.

To contribute an update to an existing component or create a new component, create a PR on GitHub. If you're new to Pipedream component development, you can start with quickstarts for trigger span and action development, and then review the component API reference.

Trigger

Description:Emit new event for each new member added to a guild
Version:0.0.3
Key:discord-new-guild-member

Discord Overview

The Discord API interacts seamlessly with Pipedream, empowering you to craft customized automations and workflows for your Discord server. With this powerful integration, you can automate tasks like message posting, user management, and notifications, based on a myriad of triggers and actions from different apps. These automations can enhance the Discord experience for community moderators and members, by synchronizing with external tools, organizing community engagement, and streamlining notifications.

Trigger Code

import discord from "../../discord.app.mjs";

export default {
  key: "discord-new-guild-member",
  name: "New Guild Member (Instant)",
  description: "Emit new event for each new member added to a guild",
  version: "0.0.3",
  dedupe: "unique",
  type: "source",
  props: {
    discord,
    discordApphook: {
      type: "$.interface.apphook",
      appProp: "discord",
      eventNames: [
        "GUILD_MEMBER_ADD",
      ],
    },
  },
  async run(event) {
    this.$emit(event, {
      id: `${event.userId}${event.guildId}`,
      summary: `Member ${event.displayName} added`,
      ts: Date.now(),
    });
  },
};

Trigger Configuration

This component may be configured based on the props defined in the component code. Pipedream automatically prompts for input values in the UI and CLI.
LabelPropTypeDescription
DiscorddiscordappThis component uses the Discord app.
discordApphook$.interface.apphook

Trigger Authentication

Discord uses OAuth authentication. When you connect your Discord account, Pipedream will open a popup window where you can sign into Discord and grant Pipedream permission to connect to your account. Pipedream securely stores and automatically refreshes the OAuth tokens so you can easily authenticate any Discord API.

Pipedream requests the following authorization scopes when you connect your account:

botemailidentifyguilds

About Discord

Use this app to create a Discord source that emits messages from your guild to a Pipedream workflow.

Action

Description:Creates a new run in Terraform. [See the documentation](https://developer.hashicorp.com/terraform/cloud-docs/api-docs/run#create-a-run)
Version:0.0.1
Key:terraform-create-run

Terraform Overview

The Terraform API allows for the automation of infrastructure as code (IaC) management tasks. With Pipedream, you can orchestrate workflows that interact with Terraform to create, update, or destroy infrastructure programmatically. You can trigger workflows with webhooks, schedule them, or run them in response to events from other services. By integrating Terraform with Pipedream, you can streamline your DevOps processes, enforce compliance, and manage infrastructure changes with ease.

Action Code

import terraform from "../../terraform.app.mjs";

export default {
  key: "terraform-create-run",
  name: "Create Run",
  description: "Creates a new run in Terraform. [See the documentation](https://developer.hashicorp.com/terraform/cloud-docs/api-docs/run#create-a-run)",
  version: "0.0.1",
  type: "action",
  props: {
    terraform,
    orgId: {
      propDefinition: [
        terraform,
        "orgId",
      ],
    },
    workspaceId: {
      propDefinition: [
        terraform,
        "workspaceId",
        (c) => ({
          orgId: c.orgId,
        }),
      ],
    },
    configurationVersion: {
      propDefinition: [
        terraform,
        "configurationVersion",
        (c) => ({
          workspaceId: c.workspaceId,
        }),
      ],
    },
    message: {
      type: "string",
      label: "Message",
      description: "Specifies the message associated with this run.",
      optional: true,
    },
    allowEmptyApply: {
      type: "boolean",
      label: "Allow Empty Apply",
      description: "Specifies whether Terraform can apply the run even when the plan [contains no changes](https://developer.hashicorp.com/terraform/cloud-docs/run/modes-and-options#allow-empty-apply). Often used to [upgrade state](https://developer.hashicorp.com/terraform/cloud-docs/workspaces/state#upgrading-state) after upgrading a workspace to a new terraform version.",
    },
    allowConfigGeneration: {
      type: "boolean",
      label: "Allow Config Generation",
      description: "Specifies whether Terraform can [generate resource configuration](https://developer.hashicorp.com/terraform/language/import/generating-configuration) when planning to import new resources. If false, import blocks without a corresponding resource block will error.",
      optional: true,
    },
    autoApply: {
      type: "boolean",
      label: "Auto Apply",
      description: "Whether to automatically apply changes when a Terraform plan is successful. Defaults to the [Auto Apply](https://developer.hashicorp.com/terraform/cloud-docs/workspaces/settings#auto-apply-and-manual-apply) workspace setting.",
      optional: true,
    },
    isDestroy: {
      type: "boolean",
      label: "Is Destroy",
      description: "Specifies whether this plan is a destroy plan that will destroy all provisioned resources. Mutually exclusive with `refresh-only`.",
      optional: true,
    },
    refresh: {
      type: "boolean",
      label: "Refresh",
      description: "Specifies whether or not to refresh the state before a plan.",
      optional: true,
    },
    refreshOnly: {
      type: "boolean",
      label: "Refresh Only",
      description: "Whether this run should refresh the state without modifying any resources. Mutually exclusive with `is-destroy`.",
      optional: true,
    },
    planOnly: {
      type: "boolean",
      label: "Plan Only",
      description: "Specifies if this is a [speculative, plan-only](https://developer.hashicorp.com/terraform/cloud-docs/run/modes-and-options#plan-only-speculative-plan) run that Terraform cannot apply. Often used in conjunction with terraform-version in order to test whether an upgrade would succeed.",
      optional: true,
    },
    savePlan: {
      type: "boolean",
      label: "Save Plan",
      description: "Specifies if this should be a saved plan run. Terraform can apply saved plan runs, but they perform their plan and checks without becoming the workspace's current run (like a plan-only run), and will only become the current run if you confirm them for apply. When creating new [configuration versions](https://developer.hashicorp.com/terraform/cloud-docs/api-docs/configuration-versions) for saved plan runs, be sure to make them `provisional`",
      optional: true,
    },
    terraformVersion: {
      type: "string",
      label: "Terraform Version",
      description: "Specifies the Terraform version to use in this run. Only valid for plan-only runs; must be a valid Terraform version available to the organization.",
      optional: true,
    },
  },
  async run({ $ }) {
    const { data } = await this.terraform.createRun({
      data: {
        data: {
          attributes: {
            "message": this.message,
            "allow-empty-apply": this.allowEmptyApply,
            "allow-config-generation": this.allowConfigGeneration,
            "auto-apply": this.autoApply,
            "is-destroy": this.isDestroy,
            "refresh": this.refresh,
            "refresh-only": this.refreshOnly,
            "plan-only": this.planOnly,
            "save-plan": this.savePlan,
            "terraform-version": this.terraformVersion,
          },
          relationships: {
            workspace: {
              data: {
                id: this.workspaceId,
              },
            },
            configurationVersion: this.configurationVersion
              ? {
                data: {
                  id: this.configurationVersion,
                },
              }
              : undefined,
          },
        },
      },
      $,
    });

    if (data) {
      $.export("$summary", `Successfully created run with ID ${data.id}.`);
    }

    return data;
  },
};

Action Configuration

This component may be configured based on the props defined in the component code. Pipedream automatically prompts for input values in the UI.

LabelPropTypeDescription
TerraformterraformappThis component uses the Terraform app.
OrganizationorgIdstringSelect a value from the drop down menu.
WorkspaceworkspaceIdstringSelect a value from the drop down menu.
Configuration VersionconfigurationVersionstringSelect a value from the drop down menu.
Messagemessagestring

Specifies the message associated with this run.

Allow Empty ApplyallowEmptyApplyboolean

Specifies whether Terraform can apply the run even when the plan contains no changes. Often used to upgrade state after upgrading a workspace to a new terraform version.

Allow Config GenerationallowConfigGenerationboolean

Specifies whether Terraform can generate resource configuration when planning to import new resources. If false, import blocks without a corresponding resource block will error.

Auto ApplyautoApplyboolean

Whether to automatically apply changes when a Terraform plan is successful. Defaults to the Auto Apply workspace setting.

Is DestroyisDestroyboolean

Specifies whether this plan is a destroy plan that will destroy all provisioned resources. Mutually exclusive with refresh-only.

Refreshrefreshboolean

Specifies whether or not to refresh the state before a plan.

Refresh OnlyrefreshOnlyboolean

Whether this run should refresh the state without modifying any resources. Mutually exclusive with is-destroy.

Plan OnlyplanOnlyboolean

Specifies if this is a speculative, plan-only run that Terraform cannot apply. Often used in conjunction with terraform-version in order to test whether an upgrade would succeed.

Save PlansavePlanboolean

Specifies if this should be a saved plan run. Terraform can apply saved plan runs, but they perform their plan and checks without becoming the workspace's current run (like a plan-only run), and will only become the current run if you confirm them for apply. When creating new configuration versions for saved plan runs, be sure to make them provisional

Terraform VersionterraformVersionstring

Specifies the Terraform version to use in this run. Only valid for plan-only runs; must be a valid Terraform version available to the organization.

Action Authentication

Terraform uses API keys for authentication. When you connect your Terraform account, Pipedream securely stores the keys so you can easily authenticate to Terraform APIs in both code and no-code steps.

About Terraform

Terraform Cloud enables infrastructure automation for provisioning, compliance, and management of any cloud, datacenter, and service.

More Ways to Connect Terraform + Discord

Create Run with Terraform API on Message Deleted (Instant) from Discord API
Discord + Terraform
 
Try it
Create Run with Terraform API on New Guild Member (Instant) from Discord API
Discord + Terraform
 
Try it
Create Run with Terraform API on Reaction Added (Instant) from Discord API
Discord + Terraform
 
Try it
List Runs with Terraform API on Message Deleted (Instant) from Discord API
Discord + Terraform
 
Try it
List Runs with Terraform API on New Guild Member (Instant) from Discord API
Discord + Terraform
 
Try it
New Message (Instant) from the Discord API

Emit new event for each message posted to one or more channels in a Discord server

 
Try it
Message Deleted (Instant) from the Discord API

Emit new event for each message deleted

 
Try it
New Command Received (Instant) from the Discord API

Emit new event for each command posted to one or more channels in a Discord server

 
Try it
New Guild Member (Instant) from the Discord API

Emit new event for each new member added to a guild

 
Try it
Reaction Added (Instant) from the Discord API

Emit new event for each reaction added to a message

 
Try it
Send Message with the Discord API

Send a simple message to a Discord channel

 
Try it
Send Message (Advanced) with the Discord API

Send a simple or structured message (using embeds) to a Discord channel

 
Try it
Send Message With File with the Discord API

Post a message with an attached file

 
Try it
Create Run with the Terraform API

Creates a new run in Terraform. See the documentation

 
Try it
List Runs with the Terraform API

Retrieves a list of runs in a workspace in Terraform. See the documentation

 
Try it

Explore Other Apps

1
-
24
of
2,400+
apps by most popular

HTTP / Webhook
HTTP / Webhook
Get a unique URL where you can send HTTP or webhook requests
Node
Node
Anything you can do with Node.js, you can do in a Pipedream workflow. This includes using most of npm's 400,000+ packages.
Python
Python
Anything you can do in Python can be done in a Pipedream Workflow. This includes using any of the 350,000+ PyPi packages available in your Python powered workflows.
OpenAI (ChatGPT)
OpenAI (ChatGPT)
OpenAI is an AI research and deployment company with the mission to ensure that artificial general intelligence benefits all of humanity. They are the makers of popular models like ChatGPT, DALL-E, and Whisper.
Premium
Salesforce
Salesforce
Web services API for interacting with Salesforce
Premium
HubSpot
HubSpot
HubSpot's CRM platform contains the marketing, sales, service, operations, and website-building software you need to grow your business.
Premium
Zoho CRM
Zoho CRM
Zoho CRM is an online Sales CRM software that manages your sales, marketing, and support in one CRM platform.
Premium
Stripe
Stripe
Stripe powers online and in-person payment processing and financial solutions for businesses of all sizes.
Shopify
Shopify
Shopify is a complete commerce platform that lets anyone start, manage, and grow a business. You can use Shopify to build an online store, manage sales, market to customers, and accept payments in digital and physical locations.
Premium
WooCommerce
WooCommerce
WooCommerce is the open-source ecommerce platform for WordPress.
Premium
Snowflake
Snowflake
A data warehouse built for the cloud
Premium
MongoDB
MongoDB
MongoDB is an open source NoSQL database management program.
Supabase
Supabase
Supabase is an open source Firebase alternative.
MySQL
MySQL
MySQL is an open-source relational database management system.
PostgreSQL
PostgreSQL
PostgreSQL is a free and open-source relational database management system emphasizing extensibility and SQL compliance.
Premium
AWS
AWS
Amazon Web Services (AWS) offers reliable, scalable, and inexpensive cloud computing services.
Premium
Twilio SendGrid
Twilio SendGrid
Send marketing and transactional email through the Twilio SendGrid platform with the Email API, proprietary mail transfer agent, and infrastructure for scalable delivery.
Amazon SES
Amazon SES
Amazon SES is a cloud-based email service provider that can integrate into any application for high volume email automation
Premium
Klaviyo
Klaviyo
Email Marketing and SMS Marketing Platform
Premium
Zendesk
Zendesk
Zendesk is award-winning customer service software trusted by 200K+ customers. Make customers happy via text, mobile, phone, email, live chat, social media.
Notion
Notion
Notion is a new tool that blends your everyday work apps into one. It's the all-in-one workspace for you and your team.
Slack
Slack
Slack is a channel-based messaging platform. With Slack, people can work together more effectively, connect all their software tools and services, and find the information they need to do their best work — all within a secure, enterprise-grade environment.
Microsoft Teams
Microsoft Teams
Microsoft Teams has communities, events, chats, channels, meetings, storage, tasks, and calendars in one place.
Schedule
Schedule
Trigger workflows on an interval or cron schedule.