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(ctx context.Context, 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 eris.Wrapf(err, "unable to create a session with credentials taken from env") } CreateSessionFromSecretError = func(err error) error { return eris.Wrapf(err, "unable to create a session with credentials taken from secret ref") } )
View Source
var ( GetClientError = func(err error) error { return eris.Wrapf(err, "unable to get aws client") } DescribeInstancesError = func(err error) error { return eris.Wrapf(err, "unable to describe instances") } )
View Source
var ( ConstructorInputError = func(factoryType string) error { return eris.Errorf("must provide %v factory for EC2 plugin", factoryType) } ConstructorGetClientError = func(name string, err error) error { return eris.Wrapf(err, "unable to get %v client for EC2 plugin", name) } ConstructorRegisterClientError = func(name string, err error) error { return eris.Wrapf(err, "unable to register %v client for EC2 plugin", name) } WrongUpstreamTypeError = func(upstream *v1.Upstream) error { return eris.Errorf("internal error: expected *v1.Upstream_AwsEc2, got %v", reflect.TypeOf(upstream.GetUpstreamType()).Name()) } UpstreamDeltaError = func() error { return eris.New("expected no difference between *v1.Upstream_AwsEc2 upstreams") } )
Functions ¶
func GetEc2Client ¶ added in v0.17.4
func GetEc2Client(cred *CredentialSpec, secrets v1.SecretList) (*ec2.EC2, error)
func GetInstancesFromDescription ¶ added in v0.17.4
func GetInstancesFromDescription(desc *ec2.DescribeInstancesOutput) []*ec2.Instance
func NewEc2InstanceLister ¶
func NewEc2InstanceLister() *ec2InstanceLister
Types ¶
type CredentialKey ¶ added in v0.17.4
type CredentialKey struct {
// contains filtered or unexported fields
}
type CredentialSpec ¶ added in v0.17.4
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 ¶ added in v0.17.4
func NewCredentialSpecFromEc2UpstreamSpec(spec *glooec2.UpstreamSpec) *CredentialSpec
func (*CredentialSpec) Arn ¶ added in v0.18.10
func (cs *CredentialSpec) Arn() string
func (*CredentialSpec) Clone ¶ added in v0.17.4
func (cs *CredentialSpec) Clone() *CredentialSpec
func (*CredentialSpec) GetKey ¶ added in v0.17.4
func (cs *CredentialSpec) GetKey() CredentialKey
func (*CredentialSpec) Region ¶ added in v0.17.4
func (cs *CredentialSpec) Region() string
func (*CredentialSpec) SecretRef ¶ added in v0.17.4
func (cs *CredentialSpec) SecretRef() *core.ResourceRef
type Ec2InstanceLister ¶ added in v0.17.4
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.