iam

package
v0.0.0-...-d0fd1eb Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2023 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateRole

func CreateRole(params *iam.CreateRoleInput, sess *session.Session) (*iam.CreateRoleOutput, error)

func GetProfileAccountAuthInfo

func GetProfileAccountAuthInfo(sess *session.Session) ([]iam.GroupDetail, []iam.UserDetail, error)

func GetProfileUsers

func GetProfileUsers(sess *session.Session) ([]iam.User, error)

GetProfileUsers will get all the users for a given profile session

func UpdateProfilesRolesSessionDuration

func UpdateProfilesRolesSessionDuration(filename string, duration int64) error

UpdateProfilesRoles will take a filename which should be the output of the GetProfilesRoles func The duration parameter is the new MaxSessDuration in seconds

func UpdateUserPassword

func UpdateUserPassword(user UserUpdate, sess *session.Session) (string, error)

func WriteProfilesPolicies

func WriteProfilesPolicies(profilesPolicies ProfilesPolicies) error

func WriteProfilesRoles

func WriteProfilesRoles(profilesRoles ProfilesRoles) error

func WriteProfilesUsers

func WriteProfilesUsers(profilesUsers ProfilesUsers) error

Types

type Document

type Document struct {
	Version   string      `json:"Version"`
	Statement []Statement `json:"Statement"`
}

two structs to help with printing the policy documents

type ProfilePolicies

type ProfilePolicies struct {
	AccountId      string
	Profile        string
	PolicyDetails  []iam.ManagedPolicyDetail
	PolicyVersions []iam.PolicyVersion
}

The Policies and PolicyVersion need to have the same index to match up for later reference

func GetProfilePolicies

func GetProfilePolicies(sess *session.Session) (ProfilePolicies, error)

type ProfileRoles

type ProfileRoles struct {
	Profile string
	Roles   []RoleInfo
}

type ProfileUsers

type ProfileUsers struct {
	Profile    string
	AccountID  string
	Users      []iam.User
	UsersInfo  []iam.UserDetail
	GroupsInfo []iam.GroupDetail
}

type ProfilesPolicies

type ProfilesPolicies []ProfilePolicies

func GetProfilesPolicies

func GetProfilesPolicies(accounts []utils.AccountInfo) (ProfilesPolicies, error)

type ProfilesRoles

type ProfilesRoles []ProfileRoles

func GetProfilesRoles

func GetProfilesRoles(accounts []utils.AccountInfo) (ProfilesRoles, error)

GetProfilesRoles will get all of the roles in all given accounts

type ProfilesUsers

type ProfilesUsers []ProfileUsers

func GetProfilesUsers

func GetProfilesUsers(accounts []utils.AccountInfo) (ProfilesUsers, error)

GetProfilesUsers will get all of the users in all given accounts

type RoleInfo

type RoleInfo struct {
	Role             iam.Role
	InlinePolicies   []string
	AttachedPolicies []string
}

func GetProfileRoles

func GetProfileRoles(sess *session.Session) ([]RoleInfo, error)

GetProfileRoles will get all the roles for a given profile session

type Statement

type Statement struct {
	Action   []string `json:"Action"`
	Resource string   `json:"Resource"`
	Effect   string   `json:"Effect"`
	Sid      string   `json:"Sid"`
}

type UserUpdate

type UserUpdate struct {
	Username      string
	ResetRequired bool
}

Jump to

Keyboard shortcuts

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