Documentation ¶
Index ¶
- Constants
- type IEC2Identity
- type Identity
- func (i *Identity) AvailabilityZone() (string, error)
- func (i *Identity) AvailabilityZoneId() (string, error)
- func (i *Identity) CredentialProvider() credentialproviders.IRemoteProvider
- func (i *Identity) Credentials() *credentials.Credentials
- func (i *Identity) IdentityType() string
- func (i *Identity) InstanceID() (string, error)
- func (i *Identity) InstanceIDWithContext(ctx context.Context) (string, error)
- func (i *Identity) InstanceType() (string, error)
- func (i *Identity) IsIdentityEnvironment() bool
- func (i *Identity) Region() (region string, err error)
- func (i *Identity) RegionWithContext(ctx context.Context) (region string, err error)
- func (i *Identity) Register(ctx context.Context) error
- func (i *Identity) VpcPrimaryCIDRBlock() (ip map[string][]string, err error)
Constants ¶
const (
// IdentityType is the identity type for EC2
IdentityType = "EC2"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type IEC2Identity ¶
type IEC2Identity interface { InstanceID() (string, error) Region() (string, error) AvailabilityZone() (string, error) AvailabilityZoneId() (string, error) InstanceType() (string, error) IsIdentityEnvironment() bool Credentials() *credentials.Credentials IdentityType() string Register() }
IEC2Identity defines the functions for the EC2 identity
type Identity ¶
type Identity struct { Log log.T Client iEC2MdsSdkClient Config *appconfig.SsmagentConfig AuthRegisterService authregister.IClient // contains filtered or unexported fields }
Identity is the struct implementing the IAgentIdentityInner interface for the EC2 identity
func NewEC2Identity ¶
NewEC2Identity initializes the ec2 identity
func (*Identity) AvailabilityZone ¶
AvailabilityZone returns the availabilityZone ec2 instance
func (*Identity) AvailabilityZoneId ¶
AvailabilityZoneId returns the availabilityZoneId ec2 instance
func (*Identity) CredentialProvider ¶
func (i *Identity) CredentialProvider() credentialproviders.IRemoteProvider
CredentialProvider returns the initialized credentials provider
func (*Identity) Credentials ¶
func (i *Identity) Credentials() *credentials.Credentials
Credentials initializes credentials for EC2 identity if none exists and returns credentials Since credentials expire in about 6 hours, setting the ExpiryWindow to 5 hours will trigger a refresh 5 hours before they actually expire. So the TTL of credentials is reduced to about 1 hour to match EC2 assume role frequency.
func (*Identity) IdentityType ¶
IdentityType returns the identity type of the ec2 instance
func (*Identity) InstanceID ¶
InstanceID returns the managed instance id
func (*Identity) InstanceIDWithContext ¶
InstanceIDWithContext returns the managed instance id
func (*Identity) InstanceType ¶
InstanceType returns the instance type of the ec2 instance
func (*Identity) IsIdentityEnvironment ¶
IsIdentityEnvironment returns if instance is a ec2 instance
func (*Identity) RegionWithContext ¶
RegionWithContext returns the region of the ec2 instance
Directories ¶
Path | Synopsis |
---|---|
Package ec2detector implements the detection of EC2 using specific sub-detectors
|
Package ec2detector implements the detection of EC2 using specific sub-detectors |
nitrodetector
Package nitrodetector implements logic to determine if we are running on an nitro hypervisor
|
Package nitrodetector implements logic to determine if we are running on an nitro hypervisor |
xendetector
Package xendetector implements logic to determine if we are running on an amazon Xen hypervisor
|
Package xendetector implements logic to determine if we are running on an amazon Xen hypervisor |