iam

package
v0.75.1 Latest Latest
Warning

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

Go to latest
Published: May 7, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

README

AWS Identity and Access Management (IAM) Service

This service is github.com/aws/aws-sdk-go/service/iam.IAM proxy

To check all supported method run

    endly -s="aws/iam"

To check method contract run endly -s="aws/iam" -a=methodName

    endly -s="aws/iam" -a=listRoles

On top of that service implements the following helper methods:

  • recreateRole: drop if exists and create new role
  • setupRole: creates or modifies role with supplied policies
Usage:
Setting up role
endly -r=setup_role

@setup_role.yaml

pipeline:
 action: aws/iam:setupRole
    credentials: aws
    rolename: myRole
    define:
      - policyname: myPolicy
        policydocument: $Cat('privilege-policy.json')
    attach:
      - policyarn: arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole
Getting role info
endly -r=get_role_info

@get_role_info.yaml

pipeline:
 info:
    action: aws/iam:getRoleInfo
    credentials: aws
    roleName: myRole
Getting user info
endly -r=get_user_info

@get_user_info.yaml

pipeline:
 info:
    action: aws/iam:getUserInfo
    credentials: aws
    roleName: myUser

Documentation

Index

Constants

View Source
const (
	//ServiceID aws iam service id.
	ServiceID = "aws/iam"
)

Variables

This section is empty.

Functions

func GetClient

func GetClient(context *endly.Context) (*iam.IAM, error)

GetClient returns iam client from context

func New

func New() endly.Service

New creates a new AWS IAM service.

Types

type DropRoleInput

type DropRoleInput iam.DeleteRoleInput

DropRoleInput deattaches all role polices and deletes role

type GetGroupInfoInput

type GetGroupInfoInput iam.GetGroupInput

type GetGroupInfoOutput

type GetGroupInfoOutput struct {
	Group    *iam.Group
	Users    []*iam.User
	Attached []*Policy
	Defined  []*Policy
}

type GetRoleInfoInput

type GetRoleInfoInput iam.GetRoleInput

type GetRoleInfoOutput

type GetRoleInfoOutput struct {
	Role     *iam.Role
	Attached []*Policy
	Defined  []*Policy
}

func (*GetRoleInfoOutput) Messages

func (o *GetRoleInfoOutput) Messages() []*msg.Message

type GetUserInfoInput

type GetUserInfoInput iam.GetUserInput

type GetUserInfoOutput

type GetUserInfoOutput struct {
	User     *iam.User
	Attached []*Policy
	Defined  []*Policy
	Groups   []*GetGroupInfoOutput
}

func (*GetUserInfoOutput) Messages

func (o *GetUserInfoOutput) Messages() []*msg.Message

type GroupEventInfo

type GroupEventInfo struct {
	Group    *string
	Arn      *string
	Users    []string          `yaml:"users,omitempty"`
	Defined  []*PolicyEvenInfo `yaml:"defined,omitempty"`
	Attached []*PolicyEvenInfo `yaml:"attached,omitempty"`
}

func NewGroupEventInfo

func NewGroupEventInfo(output *GetGroupInfoOutput, includeUsers bool) *GroupEventInfo

func (*GroupEventInfo) Messages

func (e *GroupEventInfo) Messages() []*msg.Message

type InfoStatement

type InfoStatement struct {
	SID       *string `yaml:"sid,omitempty" json:",omitempty"`
	Effect    string
	Action    interface{}
	Resource  interface{} `yaml:"resource,omitempty"  json:",omitempty"`
	Condition interface{} `yaml:"condition,omitempty"  json:",omitempty"`
	Principal interface{} `yaml:"principal,omitempty"  json:",omitempty"`
}

type Policy

type Policy struct {
	PolicyName     *string
	PolicyArn      *string
	Document       *string
	PolicyDocument *PolicyDocument
}

Policy represent policy

func (*Policy) PolicyInfo

func (p *Policy) PolicyInfo() []*InfoStatement

type PolicyDocument

type PolicyDocument struct {
	Version   string
	ID        string `json:"Id"`
	Statement []*Statement
}

PolicyDocument represent policy document

type PolicyEvenInfo

type PolicyEvenInfo struct {
	Policy   *string          `yaml:"policy,omitempty"`
	Arn      *string          `yaml:"arn,omitempty"`
	Document []*InfoStatement `yaml:"document,omitempty"`
}

type PolicyInfo

type PolicyInfo struct {
	Statement []*InfoStatement
}

type Principal

type Principal struct {
	Service string
}

Principal represents policy principal

type RecreateRoleInput

type RecreateRoleInput iam.CreateRoleInput

RecreateRoleInput drops role if exist to create a new one

type RoleEventInfo

type RoleEventInfo struct {
	Role     string
	Arn      string
	Defined  []*PolicyEvenInfo `yaml:"defined,omitempty"`
	Attached []*PolicyEvenInfo `yaml:"attached,omitempty"`
}

func NewRoleEventInfo

func NewRoleEventInfo(output *GetRoleInfoOutput) *RoleEventInfo

func (*RoleEventInfo) Messages

func (e *RoleEventInfo) Messages() []*msg.Message

type SetupRolePolicyInput

type SetupRolePolicyInput struct {
	iam.CreateRoleInput   `yaml:",inline" json:",inline"`
	DefaultPolicyDocument *string
	Attach                []*iam.AttachRolePolicyInput
	Define                []*iam.PutRolePolicyInput
}

SetupRolePolicyInput represents setup role policy input

func (*SetupRolePolicyInput) Init

func (i *SetupRolePolicyInput) Init() error

Validate checks if input is valid

func (*SetupRolePolicyInput) Validate

func (i *SetupRolePolicyInput) Validate() error

Validate checks if input is valid

type Statement

type Statement struct {
	Sid       *string
	Effect    string
	Action    toolbox.AnyJSONType `json:",omitempty"`
	Resource  toolbox.AnyJSONType `json:",omitempty"`
	Principal toolbox.AnyJSONType `json:",omitempty"`
	Condition toolbox.AnyJSONType `json:",omitempty"`
}

Statement represents policy document statement

type UserEventInfo

type UserEventInfo struct {
	User     *string
	Arn      *string
	Defined  []*PolicyEvenInfo `yaml:"defined,omitempty"`
	Attached []*PolicyEvenInfo `yaml:"attached,omitempty"`
	Groups   []*GroupEventInfo `yaml:"groups,omitempty"`
}

func NewUserEventInfo

func NewUserEventInfo(output *GetUserInfoOutput) *UserEventInfo

func (*UserEventInfo) Messages

func (e *UserEventInfo) Messages() []*msg.Message

Jump to

Keyboard shortcuts

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