Skip to content

Commit

Permalink
Docs changes and some other minor fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Lauren Voswinkel committed Feb 24, 2021
1 parent 41b5b87 commit baa29b1
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 24 deletions.
1 change: 0 additions & 1 deletion builtin/logical/aws/backend_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1438,7 +1438,6 @@ func testAccStepReadIamGroups(t *testing.T, name string, groups []string) logica
}

func TestBackend_iamTagsCrud(t *testing.T) {
t.Parallel()
logicaltest.Test(t, logicaltest.TestCase{
AcceptanceTest: true,
LogicalBackend: getBackend(t),
Expand Down
18 changes: 9 additions & 9 deletions builtin/logical/aws/secret_access_keys.go
Original file line number Diff line number Diff line change
Expand Up @@ -288,16 +288,16 @@ func (b *backend) secretAccessKeysCreate(
}
}

if len(role.IAMTags) > 0 {
var tags []*iam.Tag
for key, value := range role.IAMTags {
// This assignment needs to be done in order to create unique addresses for
// these variables. Without doing so, all the tags will be copies of the last
// tag listed in the role.
k, v := key, value
tags = append(tags, &iam.Tag{Key: &k, Value: &v})
}
var tags []*iam.Tag
for key, value := range role.IAMTags {
// This assignment needs to be done in order to create unique addresses for
// these variables. Without doing so, all the tags will be copies of the last
// tag listed in the role.
k, v := key, value
tags = append(tags, &iam.Tag{Key: &k, Value: &v})
}

if len(tags) > 0 {
_, err = iamClient.TagUser(&iam.TagUserInput{
Tags: tags,
UserName: &username,
Expand Down
55 changes: 41 additions & 14 deletions website/content/api-docs/secret/aws.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -336,20 +336,47 @@ Using groups:
```

Using tags:
```json
{
"credential_type": "iam_user",
"iam_tags": ["first_key=first_value", "second_key=second_value"]
}
```

Using tags with CLI:
```bash
vault write aws/roles/example-role \
credential_type=iam_user \
iam_tags="first_key=first_value" \
iam_tags="second_key=second_value" \
```
<Tabs>
<Tab heading="cURL">
```json
{
"credential_type": "iam_user",
"iam_tags": [
"first_key=first_value",
"second_key=second_value"
]
}
```
or
```json
{
"credential_type": "iam_user",
"iam_tags": {
"first_key": "first_value",
"second_key": "second_value"
}
}
```
</Tab>
<Tab heading="CLI">
```bash
vault write aws/roles/example-role \
credential_type=iam_user \
iam_tags="first_key=first_value" \
iam_tags="second_key=second_value" \
```
or
```bash
vault write aws/roles/example-role \
credential_type=iam_user \
iam_tags=@test.json
```
where test.json is
```json
["tag1=42", "tag2=something"]
```
</Tab>
</Tabs>

## Read Role

Expand Down

0 comments on commit baa29b1

Please sign in to comment.