Skip to content
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

Add new configuration document for connection aws #96

Merged
merged 3 commits into from
Sep 10, 2024
Merged
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
8 changes: 4 additions & 4 deletions docs/reference/config-files/connection/abuseipdb.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
title: abuseipdb
title: abuseipdb
sidebar_label: abuseipdb
---

Expand All @@ -15,9 +15,9 @@ connection "abuseipdb" "abuseipdb_api_key" {

## Arguments

| Name | Type | Required?| Description
|-----------------|---------|----------|-------------------
| `api_key` | String | Optional | API Key
| 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).

Expand Down
10 changes: 5 additions & 5 deletions docs/reference/config-files/connection/alicloud.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
title: alicloud
title: alicloud
sidebar_label: alicloud
---

Expand All @@ -16,10 +16,10 @@ connection "alicloud" "alicloud" {

## 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.
| 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).

Expand Down
78 changes: 78 additions & 0 deletions docs/reference/config-files/connection/aws.md
Original file line number Diff line number Diff line change
@@ -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
}
}
```
Loading