Skip to content

Commit

Permalink
revise connection pages
Browse files Browse the repository at this point in the history
  • Loading branch information
judell committed Jan 22, 2025
1 parent a4011c5 commit d461296
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 59 deletions.
27 changes: 11 additions & 16 deletions docs/reference/config-files/connection/aws.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,17 @@ The AWS connection type includes an implicit, default connection (`connection.aw

## Examples

### Default connection

```hcl
partition "aws_cloudtrail_log" "prod" {
source "aws_s3_bucket" {
connection = connection.aws.default
bucket = "aws-cloudtrail-logs-6054...81-fe67"
}
}
```

### Static Connections

```hcl
Expand All @@ -59,19 +70,3 @@ connection "aws" "aws_profile" {
}
```

### 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
}
}
```
14 changes: 14 additions & 0 deletions docs/reference/config-files/connection/azure.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,20 @@ All arguments are optional, and a `azure` connection with no arguments will beha

The `azure` connection type includes an implicit, default connection (`connection.azure.default`) that will be configured using the Azure environment variables:


>[!NOTE]
> the aws page illustrates default connection by showing it in use
>
> partition "aws_cloudtrail_log" "prod" {
> source "aws_s3_bucket" {
> connection = connection.aws.default
> bucket = "aws-cloudtrail-logs-6054...81-fe67"
> }
> }
>
> do the same here and for gcp and pipes?

```hcl
connection "azure" "default" {
tenant_id = env("AZURE_TENANT_ID")
Expand Down
39 changes: 0 additions & 39 deletions docs/reference/config-files/connection/gcp.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,42 +61,3 @@ connection "gcp_inline" {
}
```

### Using GCP Connections in Container Step

```hcl
pipeline "gcp_test" {
param "connection" {
type = string
default = "default"
}
step "container" "get_instances" {
image = "gcr.io/google.com/cloudsdktool/google-cloud-cli"
cmd = ["gcloud", "compute", "instances", "list"]
env = {
CLOUDSDK_CORE_PROJECT = "my-project"
CLOUDSDK_AUTH_ACCESS_TOKEN = connections.gcp[param.connection].access_token
}
}
}
```

### Using GCP Connections in HTTP Step

```hcl
pipeline "gcp_test" {
param "connection" {
type = string
default = "default"
}
step "http" "get_instances" {
url = "https://compute.googleapis.com/compute/v1/projects/my-project/aggregated/instances"
request_headers = {
Content-Type = "application/json; charset=utf-8"
Authorization = "Bearer ${connections.gcp[param.connection].access_token}"
}
}
}
```
12 changes: 8 additions & 4 deletions docs/reference/config-files/connection/pipes.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ The `pipes` connection can be used to access Turbot Pipes resources.

```hcl
connection "pipes" "pipes_connection" {
token = "spt_cbu2_FAKETOKEN_5ruln"
org_handle = "my-pipes-org"
}
```
Expand All @@ -16,10 +18,12 @@ connection "pipes" "pipes_connection" {

| 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`. |
| `token` | String | Optional | A Pipes [access token](https://turbot.com/pipes/docs/accounts/developer/advanced#tokens).
| `org_handle` | String | Optional | A Pipes organization handle.


>[!NOTE]
> Copied from azure, do these sections this apply? We have PIPES_TOKEN but I think not PIPE_ORG_HANDLE?
## Attributes (Read-Only)

Expand Down

0 comments on commit d461296

Please sign in to comment.