From ace35dc79ee32b74b6040f8e81b94ee95be53b73 Mon Sep 17 00:00:00 2001 From: Omero Saienni <39497847+omerosaienni@users.noreply.github.com> Date: Thu, 19 Sep 2024 06:42:47 +1200 Subject: [PATCH] Add connection configuration documentation (#131) * Add new configuration document for connection abuseipdb (#94) * Add new configuration document for connection alicloud (#95) * Add new configuration document for connection azure (#97) * Add new configuration document for connection bitbucket (#98) * Add new configuration document for connection clickup (#99) * Add new configuration document for connection datadog (#100) * Add new configuration document for connection discord (#101) * Add new configuration document for connection freshdesk (#102) * Add new configuration document for connection github (#103) * Add new configuration document for connection gitlab (#104) * Add new configuration document for connection ip2locationio (#105) * Add new configuration document for connection ipstack (#106) * Add new configuration document for connection jira (#107) * Add new configuration document for connection jumpcloud (#108) * Add new configuration document for connection mastodon (#109) * Add new configuration document for connection microsoft_teams (#110) * Add new configuration document for connection okta (#111) * Add new configuration document for connection opsgenie (#112) * Add new configuration document for connection openai (#113) * Add new configuration document for connection pagerduty (#114) * Add new configuration document for connection sendgrid (#115) * Add new configuration document for connection servicenow (#116) * Add new configuration document for connection slack (#117) * Add new configuration document for connection turbot_guardrails (#118) * Add new configuration document for connection turbot_pipes (#119) * Add new configuration document for connection uptime_robot (#120) * Add new configuration document for connection urlscan (#121) * Add new configuration document for connection vault (#122) * Add new configuration document for connection virus_total (#123) * Add new configuration document for connection zendesk (#124) * Add new configuration document for connection pagerduty (#125) * Add new configuration document for connection aws (#96) * Add new configuration document for connection gcp (#128) * Add new configuration document for connection slack (#127) * Create Index and Template for connection documents (#129) --- .../config-files/connection/abuseipdb.md | 32 ++++++ .../config-files/connection/alicloud.md | 55 ++++++++++ docs/reference/config-files/connection/aws.md | 78 +++++++++++++ .../config-files/connection/azure.md | 46 ++++++++ .../config-files/connection/bitbucket.md | 44 ++++++++ .../config-files/connection/clickup.md | 32 ++++++ .../config-files/connection/datadog.md | 37 +++++++ .../config-files/connection/discord.md | 38 +++++++ .../config-files/connection/freshdesk.md | 35 ++++++ docs/reference/config-files/connection/gcp.md | 103 ++++++++++++++++++ .../config-files/connection/github.md | 38 +++++++ .../config-files/connection/gitlab.md | 32 ++++++ .../config-files/connection/index.md | 76 +++++++++++++ .../config-files/connection/ip2locationio.md | 32 ++++++ .../config-files/connection/ipstack.md | 32 ++++++ .../reference/config-files/connection/jira.md | 38 +++++++ .../config-files/connection/jumpcloud.md | 32 ++++++ .../config-files/connection/mastodon.md | 24 ++++ .../reference/config-files/connection/okta.md | 41 +++++++ .../config-files/connection/openai.md | 38 +++++++ .../config-files/connection/opsgenie.md | 35 ++++++ .../config-files/connection/pagerduty.md | 32 ++++++ .../config-files/connection/pipes.md | 38 +++++++ .../config-files/connection/sendgrid.md | 38 +++++++ .../config-files/connection/servicenow.md | 38 +++++++ .../config-files/connection/slack.md | 73 +++++++++++++ .../config-files/connection/teams.md | 38 +++++++ .../config-files/connection/template.keep | 39 +++++++ .../config-files/connection/trello.md | 35 ++++++ .../connection/turbot_guardrails.md | 44 ++++++++ .../config-files/connection/uptimerobot.md | 38 +++++++ .../config-files/connection/urlscan.md | 38 +++++++ .../config-files/connection/vault.md | 41 +++++++ .../config-files/connection/virustotal.md | 32 ++++++ .../config-files/connection/zendesk.md | 38 +++++++ 35 files changed, 1480 insertions(+) create mode 100644 docs/reference/config-files/connection/abuseipdb.md create mode 100644 docs/reference/config-files/connection/alicloud.md create mode 100644 docs/reference/config-files/connection/aws.md create mode 100644 docs/reference/config-files/connection/azure.md create mode 100644 docs/reference/config-files/connection/bitbucket.md create mode 100644 docs/reference/config-files/connection/clickup.md create mode 100644 docs/reference/config-files/connection/datadog.md create mode 100644 docs/reference/config-files/connection/discord.md create mode 100644 docs/reference/config-files/connection/freshdesk.md create mode 100644 docs/reference/config-files/connection/gcp.md create mode 100644 docs/reference/config-files/connection/github.md create mode 100644 docs/reference/config-files/connection/gitlab.md create mode 100644 docs/reference/config-files/connection/index.md create mode 100644 docs/reference/config-files/connection/ip2locationio.md create mode 100644 docs/reference/config-files/connection/ipstack.md create mode 100644 docs/reference/config-files/connection/jira.md create mode 100644 docs/reference/config-files/connection/jumpcloud.md create mode 100644 docs/reference/config-files/connection/mastodon.md create mode 100644 docs/reference/config-files/connection/okta.md create mode 100644 docs/reference/config-files/connection/openai.md create mode 100644 docs/reference/config-files/connection/opsgenie.md create mode 100644 docs/reference/config-files/connection/pagerduty.md create mode 100644 docs/reference/config-files/connection/pipes.md create mode 100644 docs/reference/config-files/connection/sendgrid.md create mode 100644 docs/reference/config-files/connection/servicenow.md create mode 100644 docs/reference/config-files/connection/slack.md create mode 100644 docs/reference/config-files/connection/teams.md create mode 100644 docs/reference/config-files/connection/template.keep create mode 100644 docs/reference/config-files/connection/trello.md create mode 100644 docs/reference/config-files/connection/turbot_guardrails.md create mode 100644 docs/reference/config-files/connection/uptimerobot.md create mode 100644 docs/reference/config-files/connection/urlscan.md create mode 100644 docs/reference/config-files/connection/vault.md create mode 100644 docs/reference/config-files/connection/virustotal.md create mode 100644 docs/reference/config-files/connection/zendesk.md diff --git a/docs/reference/config-files/connection/abuseipdb.md b/docs/reference/config-files/connection/abuseipdb.md new file mode 100644 index 0000000..8492868 --- /dev/null +++ b/docs/reference/config-files/connection/abuseipdb.md @@ -0,0 +1,32 @@ +--- +title: abuseipdb +sidebar_label: abuseipdb +--- + +# abuseipdb + +The `abuseipdb` connection can be used to access AbuseIPDB resources. + +```hcl +connection "abuseipdb" "abuseipdb_api_key" { + api_key = "bfc6f1c42dfakefdxxxx26977977b2xxxsfake98f310123456789de0d" +} +``` + +## Arguments + +| Name | Type | Required? | Description | +| --------- | ------ | --------- | ----------- | +| `api_key` | String | Optional | API Key | + +All arguments are optional, and an `abuseipdb` connection with no arguments will behave the same as the [default connection](#default-connection). + +## Default Connection + +The `abuseipdb` connection type includes an implicit, default connection (`connection.abuseipdb.default`) that will be configured to set the `api_key` to the `ABUSEIPDB_API_KEY` environment variable. + +```hcl +connection "abuseipdb" "default" { + api_key = env("ABUSEIPDB_API_KEY") +} +``` diff --git a/docs/reference/config-files/connection/alicloud.md b/docs/reference/config-files/connection/alicloud.md new file mode 100644 index 0000000..6a0ab0b --- /dev/null +++ b/docs/reference/config-files/connection/alicloud.md @@ -0,0 +1,55 @@ +--- +title: alicloud +sidebar_label: alicloud +--- + +# alicloud + +The `alicloud` connection can be used to access Alibaba Cloud resources. + +```hcl +connection "alicloud" "alicloud" { + access_key = "LTAI4GBVFakeKey09Kxezv66" + secret_key = "6iNPvThisIsNotARealSecretk1sZF" +} +``` + +## Arguments + +| Name | Type | Required? | Description | +| ------------ | ------ | --------- | ------------------------------------------- | +| `access_key` | String | Optional | A static access key to use to authenticate. | +| `secret_key` | String | Optional | A static secret key to use to authenticate. | + +All arguments are optional, and a `alicloud` connection with no arguments will behave the same as the [default connection](#default-connection). + +## Default Connection + +The `alicloud` connection type includes an implicit, default connection (`connection.alicloud.default`) that will be configured using either of the following environment variables: + +1.`ALIBABACLOUD_ACCESS_KEY_ID` and `ALIBABACLOUD_ACCESS_KEY_SECRET`. + +```hcl +connection "alicloud" "default" { + access_key = env("ALIBABACLOUD_ACCESS_KEY_ID") + secret_key = env("ALIBABACLOUD_ACCESS_KEY_SECRET") +} +``` + +2.`ALICLOUD_ACCESS_KEY_ID` and `ALICLOUD_ACCESS_KEY_SECRET`. + +```hcl +connection "alicloud" "default" { + access_key = env("ALICLOUD_ACCESS_KEY_ID") + secret_key = env("ALICLOUD_ACCESS_KEY_SECRET") +} +``` + +3.`ALICLOUD_ACCESS_KEY` and `ALICLOUD_SECRET_KEY`. + +```hcl +connection "alicloud" "default" { + access_key = env("ALICLOUD_ACCESS_KEY") + secret_key = env("ALICLOUD_SECRET_KEY") +} +``` diff --git a/docs/reference/config-files/connection/aws.md b/docs/reference/config-files/connection/aws.md new file mode 100644 index 0000000..c4b3678 --- /dev/null +++ b/docs/reference/config-files/connection/aws.md @@ -0,0 +1,78 @@ +--- +title: aws +sidebar_label: aws +--- + +# aws + +The `aws` connection can be used to access Amazon Web Services resources. + +```hcl +connection "aws" "my_connection" { + profile = "aws-account-01" +} +``` + +## Arguments + +| Name | Type | Required? | Description | +| --------------- | ------ | --------- | -------------------------------------------------------------------------------------------------------------------------- | +| `profile` | String | Optional | The [AWS Profile](https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-files.html) to use to obtain connections. | +| `access_key` | String | Optional | A static AWS access key to use to authenticate. | +| `secret_key` | String | Optional | A static AWS secret key to use to authenticate. | +| `session_token` | String | Optional | A static AWS session token to use to authenticate. This is only used if you specify `access_key` and `secret_key`. | +| `ttl` | Number | Optional | The time, in seconds, to cache the connections. By default, the AWS connection will be cached for 5 minutes. | + +All arguments are optional, and an `aws` connection with no arguments will behave the same as the [AWS default connection](#default-connection). You may instead specify exactly one of: + +- `profile` +- `access_key` and `secret_key` (and optionally `session_token`) + +## Attributes (Read-Only) + +| Attribute | Type | Description | +| --------------- | ------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `access_key` | String | The AWS access key to use to authenticate. If you specified the `access_key` arg, then this is the argument value verbatim. If you have specified `profile`, then this is the resolved temporary access key for that profile. | +| `secret_key` | String | The AWS secret key to use to authenticate. If you specified the `secret_key` arg, then this is the argument value verbatim. If you have specified `profile`, then this is the resolved temporary secret key for that profile. | +| `session_token` | String | The AWS session token to use to authenticate. If you specified the `session_token` arg, then this is the argument value verbatim. If you have specified `profile`, then this is the resolved temporary session token for that profile. | +| `env` | Map | A map of the resolved [connection-related environment variables](https://docs.aws.amazon.com/sdk-for-php/v3/developer-guide/guide_connections_environment.html) (`AWS_ACCESS_KEY_ID`, `AWS_SECRET_ACCESS_KEY`, `AWS_SESSION_TOKEN`, `AWS_PROFILE`) | + +## Default Connection + +The AWS connection type includes an implicit, default connection (`connection.aws.default`) that will be configured using the same mechanism as the AWS CLI (AWS environment variables, default profile, etc); the effective connections of this default are the same as if you run the `aws` command. + +## Examples + +### Static Connections + +```hcl +connection "aws" "aws_static" { + access_key = "ASIAQGDFAKEKGUI5MCEU" + secret_key = "QhLNLGM5MBkXiZm2k2tfake+TduEaCkCdpCSLl6U" +} +``` + +### AWS Profile + +```hcl +connection "aws" "aws_profile" { + profile = "awx_prod_01" +} +``` + +### Using AWS Connections in Container Step + +```hcl +pipeline "ex1" { + param "connection" { + type = string + default = "default" + } + + step "container" "aws" { + image = "public.ecr.aws/aws-cli/aws-cli" + cmd = [ "s3", "ls" ] + env = connection.aws[param.connection].env + } +} +``` diff --git a/docs/reference/config-files/connection/azure.md b/docs/reference/config-files/connection/azure.md new file mode 100644 index 0000000..0a0ecf6 --- /dev/null +++ b/docs/reference/config-files/connection/azure.md @@ -0,0 +1,46 @@ +--- +title: azure +sidebar_label: azure +--- + +# azure + +The `azure` connection can be used to access Azure resources. + +```hcl +connection "azure" "azure_connection" { + tenant_id = "YourTenantID" + client_secret = "YourClientSecret" + client_id = "YourClientID" +} +``` + +## Arguments + +| Name | Type | Required? | Description | +| --------------- | ------ | --------- | --------------------------------------------------------------------------------------------------------------- | +| `tenant_id` | String | Optional | The Microsoft Entra tenant (directory) ID. | +| `client_id` | String | Optional | The client (application) ID of an App Registration in the tenant | +| `client_secret` | String | Optional | A client secret that was generated for the App Registration. | +| `environment` | String | Optional | The Azure cloud where your resources exist - `AzureCloud` (default), `AzureChinaCloud`, or `AzureUSGovernment`. | + +All arguments are optional, and a `azure` connection with no arguments will behave the same as the [default connection](#default-connection). + +## Attributes (Read-Only) + +| Attribute | Type | Description | +| --------- | ---- | ------------------------------------------------------------------------------------------------------------------------------------------------- | +| `env` | Map | A map of the resolved connection-related environment variables (`AZURE_TENANT_ID`, `AZURE_CLIENT_SECRET`, `AZURE_CLIENT_ID`, `AZURE_ENVIRONMENT`) | + +## Default Connection + +The `azure` connection type includes an implicit, default connection (`connection.azure.default`) that will be configured using the Azure environment variables: + +```hcl +connection "azure" "default" { + tenant_id = env("AZURE_TENANT_ID") + client_secret = env("AZURE_CLIENT_SECRET") + client_id = env("AZURE_CLIENT_ID") + environment = env("AZURE_ENVIRONMENT") +} +``` diff --git a/docs/reference/config-files/connection/bitbucket.md b/docs/reference/config-files/connection/bitbucket.md new file mode 100644 index 0000000..c28c972 --- /dev/null +++ b/docs/reference/config-files/connection/bitbucket.md @@ -0,0 +1,44 @@ +--- +title: bitbucket +sidebar_label: bitbucket +--- + +# bitbucket + +The `bitbucket` connection can be used to access Bitbucket resources. + +```hcl +connection "bitbucket" "bb_connection" { + username = "user_name" + password = "P@ss123!" + base_url = "https://api.bitbucket.org/2.0" +} +``` + +## Arguments + +| Name | Type | Required? | Description | +| ---------- | ------ | --------- | --------------------------------- | +| `username` | String | Optional | Bitbucket username | +| `password` | String | Optional | Bitbucket app password | +| `base_url` | String | Optional | Base URL of your Bitbucket Server | + +All arguments are optional, and a `bitbucket` connection with no arguments will behave the same as the [default connection](#default-connection). + +## Attributes (Read-Only) + +| Attribute | Type | Description | +| --------- | ---- | ------------------------------------------------------------------------------------------------------------------------------------- | +| `env` | Map | A map of the resolved connection-related environment variables (`BITBUCKET_USERNAME`, `BITBUCKET_PASSWORD`, `BITBUCKET_API_BASE_URL`) | + +## Default Connection + +The `bitbucket` connection type includes an implicit, default connection (`connection.bitbucket.default`) that will be configured using the environment variables `BITBUCKET_USERNAME`, `BITBUCKET_PASSWORD`, and `BITBUCKET_API_BASE_URL`. + +```hcl +connection "bitbucket" "default" { + username = env("BITBUCKET_USERNAME") + password = env("BITBUCKET_PASSWORD") + base_url = env("BITBUCKET_API_BASE_URL") +} +``` diff --git a/docs/reference/config-files/connection/clickup.md b/docs/reference/config-files/connection/clickup.md new file mode 100644 index 0000000..58412ed --- /dev/null +++ b/docs/reference/config-files/connection/clickup.md @@ -0,0 +1,32 @@ +--- +title: clickup +sidebar_label: clickup +--- + +# clickup + +The `clickup` connection can be used to access ClickUp resources. + +```hcl +connection "clickup" "my_clickup" { + token = "pk_616_L5H36X3CXXXXXXXWEAZZF0NM5" +} +``` + +## Arguments + +| Name | Type | Required?| Description +|-----------------|---------|----------|------------------- +| `token` | String | Optional | API token + +All arguments are optional, and a `clickup` connection with no arguments will behave the same as the [default connection](#default-connection). + +## Default Connection + +The `clickup` connection type includes an implicit, default connection (`connection.clickup.default`) that will be configured to set the `token` to the `CLICKUP_TOKEN` environment variable. + +```hcl +connection "clickup" "default" { + token = env("CLICKUP_TOKEN") +} +``` diff --git a/docs/reference/config-files/connection/datadog.md b/docs/reference/config-files/connection/datadog.md new file mode 100644 index 0000000..43e2e00 --- /dev/null +++ b/docs/reference/config-files/connection/datadog.md @@ -0,0 +1,37 @@ +--- +title: datadog +sidebar_label: datadog +--- + +# datadog + +The `datadog` connection can be used to access Datadog resources. + +```hcl +connection "datadog" "my_datadog_connection" { + api_key = "b1cf234................." + app_key = "1a2345bc..................." + api_url = "https://api.adoghq.com/" +} +``` + +## Arguments + +| Name | Type | Required? | Description | +| --------- | ------ | --------- | --------------- | +| `api_key` | String | Optional | API key | +| `app_key` | String | Optional | Application key | +| `api_url` | String | Optional | API URL | + +All arguments are optional, and a `datadog` connection with no arguments will behave the same as the [default connection](#default-connection). + +## Default Connection + +The `datadog` connection type includes an implicit, default connection (`connection.datadog.default`) that will be configured using the environment variables `DD_CLIENT_API_KEY`, and `DD_CLIENT_APP_KEY`. + +```hcl +connection "datadog" "my_datadog_connection" { + api_key = env("DD_CLIENT_API_KEY") + app_key = env("DD_CLIENT_APP_KEY") +} +``` diff --git a/docs/reference/config-files/connection/discord.md b/docs/reference/config-files/connection/discord.md new file mode 100644 index 0000000..ba88723 --- /dev/null +++ b/docs/reference/config-files/connection/discord.md @@ -0,0 +1,38 @@ +--- +title: discord +sidebar_label: discord +--- + +# discord + +The `discord` connection can be used to access Discord resources. + +```hcl +connection "discord" "my_discord" { + token = "00B630jSCGU4Fake5Yh4KQMFakezwE2OgVcS7N999b" +} +``` + +## Arguments + +| Name | Type | Required? | Description | +| ------- | ------ | --------- | ----------- | +| `token` | String | Optional | API token | + +All arguments are optional, and a `discord` connection with no arguments will behave the same as the [default connection](#default-connection). + +## Attributes (Read-Only) + +| Attribute | Type | Description | +| --------- | ---- | -------------------------------------------------------------------------------- | +| `env` | Map | A map of the resolved connection-related environment variables (`DISCORD_TOKEN`) | + +## Default Connection + +The `discord` connection type includes an implicit, default connection (`connection.discord.default`) that will be configured to set the `token` to the `DISCORD_TOKEN` environment variable. + +```hcl +connection "discord" "default" { + token = env("DISCORD_TOKEN") +} +``` diff --git a/docs/reference/config-files/connection/freshdesk.md b/docs/reference/config-files/connection/freshdesk.md new file mode 100644 index 0000000..f434755 --- /dev/null +++ b/docs/reference/config-files/connection/freshdesk.md @@ -0,0 +1,35 @@ +--- +title: freshdesk +sidebar_label: freshdesk +--- + +# freshdesk + +The `freshdesk` connection can be used to access Freshdesk resources. + +```hcl +connection "freshdesk" "freshdesk_connection" { + api_key = "sk-jwgthNa..." + subdomain = "domain_name" +} +``` + +## Arguments + +| Name | Type | Required? | Description | +| ----------- | ------ | --------- | ------------------- | +| `api_key` | String | Optional | Freshdesk API key | +| `subdomain` | String | Optional | Freshdesk subdomain | + +All arguments are optional, and a `freshdesk` connection with no arguments will behave the same as the [default connection](#default-connection). + +## Default Connection + +The `freshdesk` connection type includes an implicit, default connection (`connection.freshdesk.default`) that will be configured using the environment variables `FRESHDESK_API_KEY` and `FRESHDESK_SUBDOMAIN`. + +```hcl +connection "freshdesk" "default" { + api_key = env("FRESHDESK_API_KEY") + subdomain = env("FRESHDESK_SUBDOMAIN") +} +``` diff --git a/docs/reference/config-files/connection/gcp.md b/docs/reference/config-files/connection/gcp.md new file mode 100644 index 0000000..9d69cb4 --- /dev/null +++ b/docs/reference/config-files/connection/gcp.md @@ -0,0 +1,103 @@ +--- +title: gcp +sidebar_label: gcp +--- + +# gcp + +The `gcp` connection can be used to access Google Cloud Platform resources. + +```hcl +connection "gcp" "gcp_def" { + connections = "~/.config/gcloud/my_connections.json" +} +``` + +## Arguments + +| Name | Type | Required? | Description | +| ------------- | ------ | --------- | ---------------------------------------------------------------------------------------------------------------------------------------------------- | +| `credentials` | String | Optional | Either the path to a JSON credential file that contains Google application credentials or the contents of a service account key file in JSON format. | +| `ttl` | Number | Optional | The time, in seconds, to cache the connections. By default, the GP connection will be cached for 5 minutes. | + +All arguments are optional, and a `gcp` connection with no arguments will behave the same as the [GCP default connection](#default-connection). + +## Attributes (Read-Only) + +| Attribute | Type | Description | +| -------------- | ------ | ---------------------------------------------------- | +| `access_token` | String | An OAuth access token to use to authenticate to GCP. | + +## Default Connection + +The GCP connection type includes an implicit, default connection (`connection.gcp.default`) that will be configured using the same mechanism as the GCloud CLI (environment variables, config files, etc); the effective connections of this default are the same as if you run the `gcloud` command. Connections will be loaded from: + +- The path specified in the `GOOGLE_APPLICATION_CONNECTIONS` environment variable, if set; otherwise +- The standard location (`~/.config/gcloud/application_default_connections.json`) + +## Examples + +### Static Connections from Connection File + +```hcl +connection "gcp" "gcp_def" { + connections = "~/.config/gcloud/my_connections.json" +} +``` + +### Static Connections defined inline + +```hcl +connection "gcp_inline" { + #project = "my_project" + connections = <