iam

package
v0.0.0-...-a93c916 Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2022 License: Apache-2.0 Imports: 11 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Client

func Client(session client.ConfigProvider) *iam.IAM

func FriendlyNamefromARN

func FriendlyNamefromARN(arn awsarn.ARN) string

Types

type AccessKey

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

func NewAccessKey

func NewAccessKey(id string, secret string) *AccessKey

func (*AccessKey) Id

func (ak *AccessKey) Id() string

func (*AccessKey) Secret

func (ak *AccessKey) Secret() string

type AttachmentType

type AttachmentType string
const (
	RoleAttachmentType       AttachmentType = "role"
	UserAttachmentType       AttachmentType = "user"
	GroupAttachmentType      AttachmentType = "group"
	ErrAttachmentTypeUnknown aws.ErrorCode  = "AttachmentType is unknown"
)

type GroupInstance

type GroupInstance struct {
	Name string
	// contains filtered or unexported fields
}

func NewExistingGroupInstance

func NewExistingGroupInstance(name string, arn awsarn.ARN) *GroupInstance

func NewGroupInstance

func NewGroupInstance(name string) *GroupInstance

func (*GroupInstance) ARN

func (g *GroupInstance) ARN() awsarn.ARN

func (*GroupInstance) AddUser

func (g *GroupInstance) AddUser(svc iamiface.IAMAPI, userArn awsarn.ARN) error

func (*GroupInstance) Create

func (g *GroupInstance) Create(svc iamiface.IAMAPI) error

Reconcile creates or updates an AWS Group

func (*GroupInstance) Delete

func (g *GroupInstance) Delete(svc iamiface.IAMAPI) error

func (*GroupInstance) IsCreated

func (g *GroupInstance) IsCreated(svc iamiface.IAMAPI) bool

func (*GroupInstance) RemoveUser

func (g *GroupInstance) RemoveUser(svc iamiface.IAMAPI, userArn awsarn.ARN) error

func (*GroupInstance) Update

func (g *GroupInstance) Update(svc iamiface.IAMAPI) error

type LoginProfileCredentials

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

func NewLoginProfileCredentials

func NewLoginProfileCredentials(user string, pass string) *LoginProfileCredentials

func (*LoginProfileCredentials) Password

func (lpc *LoginProfileCredentials) Password() string

func (*LoginProfileCredentials) Username

func (lpc *LoginProfileCredentials) Username() string

type PolicyAttachmentInstance

type PolicyAttachmentInstance struct {
	PolicyRef awsarn.ARN
	Type      AttachmentType
	TargetRef awsarn.ARN
}

func NewPolicyAttachmentInstance

func NewPolicyAttachmentInstance(policyRef awsarn.ARN, attType AttachmentType, ref awsarn.ARN) *PolicyAttachmentInstance

func (*PolicyAttachmentInstance) ARN

Returns the target ARN when created

func (*PolicyAttachmentInstance) Create

Create attaches the referenced policy on referenced target type

func (*PolicyAttachmentInstance) Delete

Delete removes the referenced Policy from referenced target type

func (*PolicyAttachmentInstance) IsCreated

func (pa *PolicyAttachmentInstance) IsCreated(svc iamiface.IAMAPI) bool

func (*PolicyAttachmentInstance) Update

Update for PolicyAttachmentInstance doesn't do anything

type PolicyDocument

type PolicyDocument struct {
	Version   PolicyVersion    `json:"Version,omitempty"`
	Statement []StatementEntry `json:"Statement,omitempty"`
}

type PolicyInstance

type PolicyInstance struct {
	Name           string
	Description    string
	PolicyDocument PolicyDocument
	// contains filtered or unexported fields
}

func NewExistingPolicyInstance

func NewExistingPolicyInstance(name, description string, policyDoc PolicyDocument, arn awsarn.ARN) *PolicyInstance

func NewPolicyInstance

func NewPolicyInstance(name, description string, policyDoc PolicyDocument) *PolicyInstance

func (*PolicyInstance) ARN

func (p *PolicyInstance) ARN() awsarn.ARN

func (*PolicyInstance) Create

func (p *PolicyInstance) Create(svc iamiface.IAMAPI) error

Create attaches the referenced policy on referenced target type and returns the target ARN

func (*PolicyInstance) Delete

func (p *PolicyInstance) Delete(svc iamiface.IAMAPI) error

Delete removes the referenced Policy from referenced target type

func (*PolicyInstance) IsCreated

func (p *PolicyInstance) IsCreated(svc iamiface.IAMAPI) bool

func (*PolicyInstance) Update

func (p *PolicyInstance) Update(svc iamiface.IAMAPI) error

Update for PolicyInstance creates a new Policy version an sets it as active; then returns the arn

type PolicyVersion

type PolicyVersion string
const PolicyVersion20121017 PolicyVersion = "2012-10-17"

type RoleInstance

type RoleInstance struct {
	Name               string
	Description        string
	PolicyDocument     PolicyDocument
	MaxSessionDuration int64
	// contains filtered or unexported fields
}

func NewExistingRoleInstance

func NewExistingRoleInstance(name string, description string, sessionDuration int64, poldoc PolicyDocument, arn awsarn.ARN) *RoleInstance

func NewRoleInstance

func NewRoleInstance(name string, description string, sessionDuration int64, poldoc PolicyDocument) *RoleInstance

func (*RoleInstance) ARN

func (r *RoleInstance) ARN() awsarn.ARN

func (*RoleInstance) Create

func (r *RoleInstance) Create(svc iamiface.IAMAPI) error

Reconcile creates or updates an AWS Role

func (*RoleInstance) Delete

func (r *RoleInstance) Delete(svc iamiface.IAMAPI) error

func (*RoleInstance) IsCreated

func (r *RoleInstance) IsCreated(svc iamiface.IAMAPI) bool

func (*RoleInstance) Update

func (r *RoleInstance) Update(svc iamiface.IAMAPI) error

type StatementEntry

type StatementEntry struct {
	Sid       string                         `json:"Sid,omitempty"`
	Effect    string                         `json:"Effect,omitempty"`
	Principal map[string]string              `json:"Principal,omitempty"`
	Action    []string                       `json:"Action,omitempty"`
	Resource  []string                       `json:"Resource,omitempty"`
	Condition map[string]map[string][]string `json:"Condition,omitempty"`
}

type UserInstance

type UserInstance struct {
	Name         string
	LoginProfile bool

	ProgrammaticAccess bool
	// contains filtered or unexported fields
}

func NewExistingUserInstance

func NewExistingUserInstance(name string, loginProfile, existingLoginProfile, programmaticAccess, existingAccessKey bool, arn awsarn.ARN) *UserInstance

func NewUserInstance

func NewUserInstance(name string, loginProfile, programmaticAccess bool) *UserInstance

func (*UserInstance) ARN

func (u *UserInstance) ARN() awsarn.ARN

func (*UserInstance) AccessKey

func (u *UserInstance) AccessKey() *AccessKey

func (*UserInstance) Create

func (u *UserInstance) Create(svc iamiface.IAMAPI) error

Create creates an AWS User

func (*UserInstance) Delete

func (u *UserInstance) Delete(svc iamiface.IAMAPI) error

func (*UserInstance) IsCreated

func (u *UserInstance) IsCreated(svc iamiface.IAMAPI) bool

func (*UserInstance) LoginProfileCredentials

func (u *UserInstance) LoginProfileCredentials() *LoginProfileCredentials

func (*UserInstance) Update

func (u *UserInstance) Update(svc iamiface.IAMAPI) error

Jump to

Keyboard shortcuts

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