Documentation ¶
Index ¶
- Constants
- Variables
- func GetEc2Client(cred *CredentialSpec, secrets v1.SecretList) (*ec2.EC2, error)
- func GetInstancesFromDescription(desc *ec2.DescribeInstancesOutput) []*ec2.Instance
- func NewEc2InstanceLister() *ec2InstanceLister
- func NewPlugin(secretFactory factory.ResourceClientFactory) *plugin
- type CredentialKey
- type CredentialSpec
- type Ec2InstanceLister
- type FilterMap
Constants ¶
View Source
const DefaultPort = 80
View Source
const InstanceIdAnnotationKey = "instanceId"
Variables ¶
View Source
var ( CreateSessionFromEnvError = func(err error) error { return errors.Wrapf(err, "unable to create a session with credentials taken from env") } CreateSessionFromSecretError = func(err error) error { return errors.Wrapf(err, "unable to create a session with credentials taken from secret ref") } )
View Source
var ( GetClientError = func(err error) error { return errors.Wrapf(err, "unable to get aws client") } DescribeInstancesError = func(err error) error { return errors.Wrapf(err, "unable to describe instances") } )
View Source
var ( ConstructorInputError = func(factoryType string) error { return errors.Errorf("must provide %v factory for EC2 plugin", factoryType) } ConstructorGetClientError = func(name string, err error) error { return errors.Wrapf(err, "unable to get %v client for EC2 plugin", name) } ConstructorRegisterClientError = func(name string, err error) error { return errors.Wrapf(err, "unable to register %v client for EC2 plugin", name) } WrongUpstreamTypeError = func(upstream *v1.Upstream) error { return errors.Errorf("internal error: expected *v1.UpstreamSpec_AwsEc2, got %v", reflect.TypeOf(upstream.UpstreamSpec.UpstreamType).Name()) } UpstreamDeltaError = func() error { return errors.New("expected no difference between *v1.UpstreamSpec_AwsEc2 upstreams") } )
Functions ¶
func GetEc2Client ¶
func GetEc2Client(cred *CredentialSpec, secrets v1.SecretList) (*ec2.EC2, error)
func GetInstancesFromDescription ¶
func GetInstancesFromDescription(desc *ec2.DescribeInstancesOutput) []*ec2.Instance
func NewEc2InstanceLister ¶
func NewEc2InstanceLister() *ec2InstanceLister
func NewPlugin ¶
func NewPlugin(secretFactory factory.ResourceClientFactory) *plugin
Types ¶
type CredentialKey ¶
type CredentialKey struct {
// contains filtered or unexported fields
}
type CredentialSpec ¶
type CredentialSpec struct {
// contains filtered or unexported fields
}
a credential spec represents an AWS client's view into AWS credentialMap we expect multiple upstreams to share the same view (so we batch the queries and apply filters locally)
func NewCredentialSpecFromEc2UpstreamSpec ¶
func NewCredentialSpecFromEc2UpstreamSpec(spec *glooec2.UpstreamSpec) *CredentialSpec
func (*CredentialSpec) Arn ¶
func (cs *CredentialSpec) Arn() string
func (*CredentialSpec) Clone ¶
func (cs *CredentialSpec) Clone() *CredentialSpec
func (*CredentialSpec) GetKey ¶
func (cs *CredentialSpec) GetKey() CredentialKey
func (*CredentialSpec) Region ¶
func (cs *CredentialSpec) Region() string
func (*CredentialSpec) SecretRef ¶
func (cs *CredentialSpec) SecretRef() *core.ResourceRef
type Ec2InstanceLister ¶
type Ec2InstanceLister interface {
ListForCredentials(ctx context.Context, cred *CredentialSpec, secrets v1.SecretList) ([]*ec2.Instance, error)
}
Ec2InstanceLister is a simple interface for calling the AWS API. This allows us to easily mock the API in our tests.
Source Files ¶
Click to show internal directories.
Click to hide internal directories.