awsiam

package
v0.0.0-...-51c5060 Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2023 License: CC0-1.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type IAMPolicyClient

type IAMPolicyClient struct {
	// contains filtered or unexported fields
}

func NewIAMPolicyClient

func NewIAMPolicyClient(region string, logger lager.Logger) *IAMPolicyClient

func (*IAMPolicyClient) CreateAssumeRole

func (ip *IAMPolicyClient) CreateAssumeRole(policy string, rolename string) (*iam.Role, error)

create new assumable role with the trust policy

func (*IAMPolicyClient) CreatePolicyAttachRole

func (ip *IAMPolicyClient) CreatePolicyAttachRole(policyname string, policy string, role iam.Role) (policyarn string, err error)

create a new policy and attach to a specific role this does not validate the policy

func (*IAMPolicyClient) CreatePolicyFromTemplate

func (ip *IAMPolicyClient) CreatePolicyFromTemplate(
	policyName,
	iamPath,
	policyTemplate string,
	resources []string,
) (string, error)

func (*IAMPolicyClient) CreateUserPolicy

func (ip *IAMPolicyClient) CreateUserPolicy(policy string, policyname string, username string) (string, error)

create a policy and attach to a user, return the policy ARN the does not validate the policy

func (*IAMPolicyClient) DeletePolicy

func (ip *IAMPolicyClient) DeletePolicy(policyARN string) error

func (IAMPolicyClient) UpdateExistingPolicy

func (ip IAMPolicyClient) UpdateExistingPolicy(policyARN string, policyStatements []PolicyStatementEntry) (*iam.PolicyVersion, error)

update a specific policy by adding new statements and updating the policyversion this does not validate the policy

type IAMUserClient

type IAMUserClient struct {
	// contains filtered or unexported fields
}

func NewIAMUserClient

func NewIAMUserClient(
	iamsvc iamiface.IAMAPI,
	logger lager.Logger,
) *IAMUserClient

func (*IAMUserClient) AttachUserPolicy

func (i *IAMUserClient) AttachUserPolicy(userName string, policyARN string) error

func (*IAMUserClient) Create

func (i *IAMUserClient) Create(userName, iamPath string) (string, error)

func (*IAMUserClient) CreateAccessKey

func (i *IAMUserClient) CreateAccessKey(userName string) (string, string, error)

func (*IAMUserClient) Delete

func (i *IAMUserClient) Delete(userName string) error

func (*IAMUserClient) DeleteAccessKey

func (i *IAMUserClient) DeleteAccessKey(userName, accessKeyID string) error

func (*IAMUserClient) Describe

func (i *IAMUserClient) Describe(userName string) (UserDetails, error)

func (*IAMUserClient) DetachUserPolicy

func (i *IAMUserClient) DetachUserPolicy(userName string, policyARN string) error

func (*IAMUserClient) ListAccessKeys

func (i *IAMUserClient) ListAccessKeys(userName string) ([]string, error)

func (*IAMUserClient) ListAttachedUserPolicies

func (i *IAMUserClient) ListAttachedUserPolicies(userName, iamPath string) ([]string, error)

type PolicyDocument

type PolicyDocument struct {
	Version   string
	Statement []PolicyStatementEntry
}

func (*PolicyDocument) AddNewStatements

func (pd *PolicyDocument) AddNewStatements(newStatements []PolicyStatementEntry) bool

adds any policy statement entries that dont already exist in the policy doc using string comparison

func (*PolicyDocument) FromString

func (pd *PolicyDocument) FromString(docstring string) error

func (*PolicyDocument) ToString

func (pd *PolicyDocument) ToString() (string, error)

type PolicyStatementEntry

type PolicyStatementEntry struct {
	Effect   string
	Action   []string
	Resource []string
}

func (*PolicyStatementEntry) ToString

func (ps *PolicyStatementEntry) ToString() (string, error)

type UserDetails

type UserDetails struct {
	UserName string
	UserARN  string
	UserID   string
}

Jump to

Keyboard shortcuts

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