test/image: use t4g.micro instance type for aarch64

The instance type is arch-dependant, therefore it's needed to pick the right
one for a given arch.

Signed-off-by: Ondřej Budai <ondrej@budai.cz>
This commit is contained in:
Ondřej Budai 2020-11-30 11:25:22 +01:00 committed by msehnout
parent 67d6b58e24
commit 7256a92d15
2 changed files with 14 additions and 3 deletions

View file

@ -179,7 +179,7 @@ func DeleteEC2Image(e *ec2.EC2, imageDesc *imageDescription) error {
// WithBootedImageInEC2 runs the function f in the context of booted
// image in AWS EC2
func WithBootedImageInEC2(e *ec2.EC2, securityGroupName string, imageDesc *imageDescription, publicKey string, f func(address string) error) (retErr error) {
func WithBootedImageInEC2(e *ec2.EC2, securityGroupName string, imageDesc *imageDescription, publicKey string, instanceType string, f func(address string) error) (retErr error) {
// generate user data with given public key
userData, err := CreateUserData(publicKey)
if err != nil {
@ -224,7 +224,7 @@ func WithBootedImageInEC2(e *ec2.EC2, securityGroupName string, imageDesc *image
MaxCount: aws.Int64(1),
MinCount: aws.Int64(1),
ImageId: imageDesc.Id,
InstanceType: aws.String("t3.micro"),
InstanceType: aws.String(instanceType),
SecurityGroupIds: []*string{securityGroup.GroupId},
UserData: aws.String(encodeBase64(userData)),
})