Sha256: 13bc3c7c7f3da206ab7c6115d035296a77bcba95044c6b930cbadd357b618fbd

Contents?: true

Size: 1.15 KB

Versions: 10

Compression:

Stored size: 1.15 KB

Contents

---
title: AWS Secrets
nav_text: Secrets Data
categories: helpers-aws
---

The `aws_secret_data` helper fetches secret data that is designed to be in one single file from AWS Secrets.

## Example

For example if you have these secret values stored as one file with multiple values separated by `=`.

    $ aws secretsmanager get-secret-value --secret-id demo-dev-secret-data | jq '.SecretString'
    KEY1=secretvalue1
    KEY2=secretvalue2

Kubes can fetch the secret data and base64 encode the values properly.  Example:

.kubes/resources/shared/secret.yaml

```yaml
apiVersion: v1
kind: Secret
metadata:
  name: demo
  labels:
    app: demo
data:
<%= aws_secret_data("demo-dev-secret-data") %>
```

Notice how the text is idented properly by 2 spaces and the values are automatically base64 encoded.

.kubes/output/shared/secret.yaml

```yaml
metadata:
  namespace: demo
  name: demo-2a78a13682
  labels:
    app: demo
apiVersion: v1
kind: Secret
data:
  KEY1: c2VjcmV0dmFsdWUx
  KEY2: c2VjcmV0dmFsdWUy
```

## Options

Here's an example of the available options for `aws_secret_data`.

```ruby
aws_secret_data("demo-#{Kubes.env}-secret-data", base64: true, ident: 2)
```

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
kubes-0.9.3 docs/_docs/helpers/aws/secret_data.md
kubes-0.9.2 docs/_docs/helpers/aws/secret_data.md
kubes-0.9.1 docs/_docs/helpers/aws/secret_data.md
kubes-0.9.0 docs/_docs/helpers/aws/secret_data.md
kubes-0.8.10 docs/_docs/helpers/aws/secret_data.md
kubes-0.8.9 docs/_docs/helpers/aws/secret_data.md
kubes-0.8.8 docs/_docs/helpers/aws/secret_data.md
kubes-0.8.7 docs/_docs/helpers/aws/secret_data.md
kubes-0.8.6 docs/_docs/helpers/aws/secret_data.md
kubes-0.8.5 docs/_docs/helpers/aws/secret_data.md