package
1.1.7
Repository: https://github.com/l50/awsutils.git
Documentation: pkg.go.dev

# README

awsutils/iam

The iam package is a collection of utility functions designed to simplify common iam tasks.


Table of contents


Functions

AWSService.GetAWSIdentity()

GetAWSIdentity() *AWSIdentity, error

GetAWSIdentity retrieves the AWS identity of the caller.

Returns:

*AWSIdentity: A pointer to the AWSIdentity of the caller. error: An error if any issue occurs while trying to get the AWS identity.


AWSService.GetInstanceProfile(string)

GetInstanceProfile(string) *types.InstanceProfile, error

GetInstanceProfile retrieves the instance profile for a given profile name.

Parameters:

profileName: The name of the profile to retrieve.

Returns:

*types.InstanceProfile: A pointer to the InstanceProfile. error: An error if any issue occurs while trying to get the instance profile.


NewAWSService()

NewAWSService() *AWSService, error

NewAWSService creates a new AWSService with the default AWS configuration.

Returns:

*AWSService: A pointer to the newly created AWSService. error: An error if any issue occurs while trying to create the AWSService.


Installation

To use the awsutils/iam package, you first need to install it. Follow the steps below to install via go get.

go get github.com/l50/awsutils/iam

Usage

After installation, you can import the package in your Go project using the following import statement:

import "github.com/l50/awsutils/iam"

Tests

To ensure the package is working correctly, run the following command to execute the tests for awsutils/iam:

go test -v

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.


License

This project is licensed under the MIT License - see the LICENSE file for details.

# Functions

NewAWSService creates a new AWSService with the default AWS configuration.

# Structs

AWSIdentity represents the identity of an AWS account.
AWSService represents the AWS services needed for the application.

# Interfaces

IdentityClientAPI represents the interface needed to make calls to the AWS IAM service.
STSClientAPI represents the interface needed to make calls to the AWS STS service.