Skip to content

(Draft) Chore: Add Devcontainer config to enable testing in GitHub Codespaces #5

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 7 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 41 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
// README at: https://github.com/devcontainers/templates/tree/main/src/go
{
"name": "Terraform Dev Container",
"image": "mcr.microsoft.com/devcontainers/go:0-1.20",

// Features to add to the dev container. More info: https://containers.dev/features.
"features": {
"ghcr.io/devcontainers/features/node:1": {},
"ghcr.io/devcontainers/features/terraform:1": {},
"ghcr.io/devcontainers-contrib/features/prettier:1": {}
},

// Configure tool-specific properties.
"customizations": {
"vscode": {
"extensions": [
"DavidAnson.vscode-markdownlint",
"GitHub.vscode-pull-request-github",
"golang.go",
"hashicorp.terraform",
"redhat.vscode-yaml"
]
},
"codespaces": {
"openFiles": [
"README.md",
"examples/README.md"
]
}
}

// Use 'forwardPorts' to make a list of ports inside the container available locally.
// "forwardPorts": [],

// Use 'postCreateCommand' to run commands after the container is created.
// "postCreateCommand": "go version",

// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
// "remoteUser": "root"
}
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,10 @@ provider_installation {

Your `<PATH>` may vary depending on how your Go environment variables are configured. Execute `go env GOBIN` to set it, then set the `<PATH>` to the value returned. If nothing is returned, set it to the default location, `$HOME/go/bin`.

### Running the Example Project

If you just want to see the Terraform provider in action, please see the [example project README](./examples/README.md).

### Contributions

While we value open-source contributions to this SDK, this library is generated programmatically.
Expand Down
33 changes: 32 additions & 1 deletion examples/README.md
Original file line number Diff line number Diff line change
@@ -1 +1,32 @@
# TODO
# Running the examples

## Create a Codespace (Optional)

Optionally, you can run the examples using a Dev Container in GitHub Codespaces. To do so, click the "+" at the root of the repo, then follow the steps to launch a new Codespace using the provided devcontainer config.

The default pre-configured devcontainer comes with all of the tools you will need already preinstalled, including: Terraform, Node/NPM, Prettier, TFLint, etc.

If you prefer not to use the pre-defined Devcontainer, you can use any suitable dev environment where Terraform is installed.

## Example Prereqs

1. A Google Sheet to use as the load Destination.
1. Your Google Creds so that Airbyte can authenticate to the Google Sheet.
1. Airbyte API Key to use when reading and writing Airbyte config using the Airbyte API.

### Running the Example

```console
echo "Switching to the example project directory..."
cd examples/pokeapi

echo "Initializing the Terraform provider..."
terraform init

echo "Printing the deployment plan..."
echo "You will be prompted for input variables as needed."
terraform plan

echo "Applying the plan and deploying to the Airbyte service..."
terraform apply
```