ListAccessKeys

command
v0.0.0-...-e8b88a3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 22, 2021 License: Apache-2.0 Imports: 6 Imported by: 0

README

ListAccessKeysv2.go

This example retrieves the access keys for your IAM account.

go run ListAccessKeysv2.go -u USER-NAME -m MAX-KEYS

  • USER-NAME is the name of the user for which the keys are listed.
  • MAX-KEYS is the maximum number of keys to display. If this value is negative, the code example sets it to 10.

The unit test accepts similar values in config.json.

Notes

  • We recommend that you grant this code least privilege, or at most the minimum permissions required to perform the task. For more information, see Grant Least Privilege in the AWS Identity and Access Management User Guide.
  • This code has not been tested in all AWS Regions. Some AWS services are available only in specific Regions.
  • Running this code might result in charges to your AWS account.

Running the unit tests

Unit tests should delete any resources they create. However, they might result in charges to your AWS account.

To run a unit test, enter:

go test

You should see something like the following, where PATH is the path to the folder containing the Go files:

PASS
ok      PATH 6.593s

If you want to see any log messages, enter:

go test -v

You should see some additional log messages. The last two lines should be similar to the previous output shown.

Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. SPDX-License-Identifier: Apache-2.0

Documentation

Overview

Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. SPDX - License - Identifier: Apache - 2.0 snippet-start:[iam.go-v2.ListAccessKeys]

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL