ssmec2roleprovider

package
v0.0.0-...-0117b6e Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const ProviderName = "SSMEC2RoleProvider"

ProviderName is the role provider name that is returned with credentials

View Source
const RegistrationType = "EC2"

Variables

This section is empty.

Functions

func EmptyCredentials

func EmptyCredentials() credentials.Value

EmptyCredentials returns empty SSMEC2RoleProvider credentials

Types

type InstanceInfo

type InstanceInfo struct {
	InstanceId string
	Region     string
}

InstanceInfo contains information about current EC2 instance

type SSMEC2RoleProvider

type SSMEC2RoleProvider struct {
	credentials.Expiry
	// ExpiryWindow will allow the credentials to trigger refreshing prior to
	// the credentials actually expiring. This is beneficial so race conditions
	// with expiring credentials do not cause request to fail unexpectedly
	// due to ExpiredTokenException exceptions.
	//
	// So a ExpiryWindow of 10s would cause calls to IsExpired() to return true
	// 10 seconds before the credentials are actually expired.
	//
	// If ExpiryWindow is 0 or less it will be ignored.
	ExpiryWindow time.Duration
	Config       *appconfig.SsmagentConfig
	Log          log.T

	IMDSClient iirprovider.IEC2MdsSdkClient

	InstanceInfo *InstanceInfo
	// contains filtered or unexported fields
}

SSMEC2RoleProvider sends requests for credentials to systems manager signed with AWS SigV4

func (*SSMEC2RoleProvider) Retrieve

func (p *SSMEC2RoleProvider) Retrieve() (credentials.Value, error)

Retrieve retrieves EC2 credentials from Systems Manager

func (*SSMEC2RoleProvider) RetrieveWithContext

func (p *SSMEC2RoleProvider) RetrieveWithContext(ctx context.Context) (credentials.Value, error)

Jump to

Keyboard shortcuts

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