rolemanager

package
v0.30.1 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2020 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CreateRoleWithPolicyInput

type CreateRoleWithPolicyInput struct {
	RoleName                 string
	RoleDescription          string
	AssumeRolePolicyDocument string
	MaxSessionDuration       int64
	PolicyName               string
	PolicyDocument           string
	PolicyDescription        string
	Tags                     []*iam.Tag
	// If false, method will fail if the role/policy/attachment already exists.
	// If true, these errors will be logged and ignored
	IgnoreAlreadyExistsErrors bool
}

type CreateRoleWithPolicyOutput

type CreateRoleWithPolicyOutput struct {
	RoleName   string
	RoleArn    string
	PolicyName string
	PolicyArn  string
}

CreateRoleWithPolicyOutput - Output of the CreateRoleWithPolicy func

type DestroyRoleWithPolicyInput

type DestroyRoleWithPolicyInput struct {
	RoleName  string
	PolicyArn string
}

type DestroyRoleWithPolicyOutput

type DestroyRoleWithPolicyOutput struct {
	RoleName  string
	PolicyArn string
}

type IAMPolicyManager

type IAMPolicyManager struct {
	IAM awsiface.IAM
}

IAMPolicyManager has the interface to the AWS Session

func (*IAMPolicyManager) DeletePolicyVersion

func (rm *IAMPolicyManager) DeletePolicyVersion(arn string, versionID string) error

DeletePolicyVersion delete a version of a template

func (*IAMPolicyManager) MergePolicy

func (rm *IAMPolicyManager) MergePolicy(input *MergePolicyInput) error

MergePolicy creates or updates the policy

func (*IAMPolicyManager) PrunePolicyVersions

func (rm *IAMPolicyManager) PrunePolicyVersions(arn string) error

PrunePolicyVersions to prune the oldest version if at 5 versions

func (*IAMPolicyManager) SetIAMClient

func (rm *IAMPolicyManager) SetIAMClient(iamClient awsiface.IAM)

SetIAMClient allows consumer to set IAM session in IAMRoleManager stuct

type IAMRoleManager

type IAMRoleManager struct {
	IAM awsiface.IAM
}

func (*IAMRoleManager) CreateRoleWithPolicy

func (rm *IAMRoleManager) CreateRoleWithPolicy(input *CreateRoleWithPolicyInput) (*CreateRoleWithPolicyOutput, error)

CreateRoleWithPolicy - Create a Role, and attach a policy to it

func (*IAMRoleManager) DestroyRoleWithPolicy

func (*IAMRoleManager) SetIAMClient

func (rm *IAMRoleManager) SetIAMClient(iamClient awsiface.IAM)

SetSession allows consumer to set IAM session in IAMRoleManager stuct

type MergePolicyInput

type MergePolicyInput struct {
	PolicyArn         arn.ARN
	PolicyName        string
	PolicyDocument    string
	PolicyDescription string
}

MergePolicyInput defines what we need to create and upate a policy

type Policy

type Policy struct {
	Name               string
	RolePolicyDocument string
	RolePolicyArn      string
	Description        string
}

type PolicyManager

type PolicyManager interface {
	MergePolicy(input *MergePolicyInput) error
	SetIAMClient(iamClient awsiface.IAM)
	PrunePolicyVersions(arn string) error
	DeletePolicyVersion(arn string, versionID string) error
}

PolicyManager updates and manages policy versions

type RoleManager

type RoleManager interface {
	CreateRoleWithPolicy(input *CreateRoleWithPolicyInput) (*CreateRoleWithPolicyOutput, error)
	SetIAMClient(iamClient awsiface.IAM)
	DestroyRoleWithPolicy(input *DestroyRoleWithPolicyInput) (*DestroyRoleWithPolicyOutput, *errors2.MultiError)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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