Documentation ¶
Index ¶
- 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 ¶
This section is empty.
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 ¶ 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
func NewPlugin ¶
func NewPlugin(secretFactory factory.ResourceClientFactory) *plugin
Types ¶
type CredentialKey ¶ added in v0.17.4
type CredentialKey string
Since "==" is not defined for slices, slices (in particular, the roleArns slice) cannot be used as keys for go maps. Instead, we will use a string form. We give it a name for clarity.
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) Arns ¶ added in v0.17.4
func (cs *CredentialSpec) Arns() []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.
Click to show internal directories.
Click to hide internal directories.