iamutil

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ActionSTSAssumeRole = "sts:AssumeRole"
)

Variables

View Source
var (
	ErrIAMClientNotSet  = errors.New("aws iam client not set")
	ErrPolicyNameNotSet = errors.New("aws policy name not set")
	ErrRoleNameNotSet   = errors.New("aws role name not set")
	ErrUserNameNotSet   = errors.New("aws user name not set")
)

Functions

func CreatePolicyDocumentCreateRoleWithTrustedUserARN

func CreatePolicyDocumentCreateRoleWithTrustedUserARN(roleName string, trustedUserARN string) policy.Policy

func ParsePolicy

func ParsePolicy(b []byte) (*policy.Policy, error)

Types

type CreatePolicyInput

type CreatePolicyInput struct {
	PolicyName     string        // required
	PolicyDocument policy.Policy // required
	Description    *string
	Path           *string
	Tags           []types.Tag
}

CreatePolicyInput is a representation of the AWS v2 SDK Create Policy Input where the Policy Name is required as a string and the Policy Document is required as a struct (vs. string). See more at: https://pkg.go.dev/github.com/aws/aws-sdk-go-v2/service/iam#CreatePolicyInput , https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_grammar.html .

func (CreatePolicyInput) Request

func (input CreatePolicyInput) Request() (*iam.CreatePolicyInput, error)

type CreateRoleInput

type CreateRoleInput struct {
	RoleName                 string        // required
	AssumeRolePolicyDocument policy.Policy // required
	iam.CreateRoleInput
}

CreateRoleInput is a representation of the AWS v2 SDK Create Role Input where the AssumeRolePolicyDocument required as a `policy.Policy` struct.

func (CreateRoleInput) Request

func (input CreateRoleInput) Request() (*iam.CreateRoleInput, error)

type CreateUserInput

type CreateUserInput struct {
	UserName string // required
	iam.CreateUserInput
}

CreateRoleInput is a representation of the AWS v2 SDK Create Uuser Input where the UserName property is required.

func (CreateUserInput) Request

func (input CreateUserInput) Request() (*iam.CreateUserInput, error)

type IAMService

type IAMService struct {
	AWSIAMClient *iam.Client
	Policies     *PolicyService
	Roles        *RoleService
	Users        *UserService
}

func NewIAMService

func NewIAMService(ctx context.Context, cfg *config.AWSConfig, optFns ...func(*iam.Options)) (*IAMService, error)

type RoleService

type RoleService struct {
	AWSIAMClient *iam.Client
}

type UserService

type UserService struct {
	AWSIAMClient *iam.Client
}

func (UserService) CreateSimple

func (svc UserService) CreateSimple(ctx context.Context, username string, params *CreateUserInput, optFns ...func(*iam.Options)) (*types.User, *iam.CreateUserOutput, error)

Jump to

Keyboard shortcuts

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