@@ -647,6 +647,25 @@ func GetLaunchPermissionsForAmiContextE(t testing.TestingT, ctx context.Context,
647647 return output .LaunchPermissions , nil
648648}
649649
650+ // GetLaunchPermissionsForAmiContext returns launchPermissions as configured in AWS.
651+ // This function will fail the test if there is an error.
652+ // The ctx parameter supports cancellation and timeouts.
653+ func GetLaunchPermissionsForAmiContext (t testing.TestingT , ctx context.Context , awsRegion string , amiID string ) []types.LaunchPermission {
654+ t .Helper ()
655+ output , err := GetLaunchPermissionsForAmiContextE (t , ctx , awsRegion , amiID )
656+ require .NoError (t , err )
657+
658+ return output
659+ }
660+
661+ // GetLaunchPermissionsForAmi returns launchPermissions as configured in AWS.
662+ //
663+ // Deprecated: Use [GetLaunchPermissionsForAmiContext] instead.
664+ func GetLaunchPermissionsForAmi (t testing.TestingT , awsRegion string , amiID string ) []types.LaunchPermission {
665+ t .Helper ()
666+ return GetLaunchPermissionsForAmiContext (t , context .Background (), awsRegion , amiID )
667+ }
668+
650669// GetLaunchPermissionsForAmiE returns launchPermissions as configured in AWS
651670//
652671// Deprecated: Use [GetLaunchPermissionsForAmiContextE] instead.
@@ -734,6 +753,38 @@ func GetRecommendedInstanceTypeWithClientContextE(t testing.TestingT, ctx contex
734753 return PickRecommendedInstanceTypeE (availabilityZones , instanceTypeOfferings , instanceTypeOptions )
735754}
736755
756+ // GetRecommendedInstanceTypeWithClientContext takes in a list of EC2 instance types (e.g., "t2.micro", "t3.micro") and returns the
757+ // first instance type in the list that is available in all Availability Zones (AZs) in the given region. If there's no
758+ // instance available in all AZs, this function exits with an error. This is useful because certain instance types,
759+ // such as t2.micro, are not available in some of the newer AZs, while t3.micro is not available in some of the older
760+ // AZs. If you have code that needs to run on a "small" instance across all AZs in many different regions, you can
761+ // use this function to automatically figure out which instance type you should use.
762+ // This function expects an authenticated EC2 client from the AWS SDK Go library.
763+ // This function will fail the test if there is an error.
764+ // The ctx parameter supports cancellation and timeouts.
765+ func GetRecommendedInstanceTypeWithClientContext (t testing.TestingT , ctx context.Context , ec2Client * ec2.Client , instanceTypeOptions []string ) string {
766+ t .Helper ()
767+ out , err := GetRecommendedInstanceTypeWithClientContextE (t , ctx , ec2Client , instanceTypeOptions )
768+ require .NoError (t , err )
769+
770+ return out
771+ }
772+
773+ // GetRecommendedInstanceTypeWithClient takes in a list of EC2 instance types (e.g., "t2.micro", "t3.micro") and returns the
774+ // first instance type in the list that is available in all Availability Zones (AZs) in the given region. If there's no
775+ // instance available in all AZs, this function exits with an error. This is useful because certain instance types,
776+ // such as t2.micro, are not available in some of the newer AZs, while t3.micro is not available in some of the older
777+ // AZs. If you have code that needs to run on a "small" instance across all AZs in many different regions, you can
778+ // use this function to automatically figure out which instance type you should use.
779+ // This function expects an authenticated EC2 client from the AWS SDK Go library.
780+ // This function will fail the test if there is an error.
781+ //
782+ // Deprecated: Use [GetRecommendedInstanceTypeWithClientContext] instead.
783+ func GetRecommendedInstanceTypeWithClient (t testing.TestingT , ec2Client * ec2.Client , instanceTypeOptions []string ) string {
784+ t .Helper ()
785+ return GetRecommendedInstanceTypeWithClientContext (t , context .Background (), ec2Client , instanceTypeOptions )
786+ }
787+
737788// GetRecommendedInstanceTypeWithClientE takes in a list of EC2 instance types (e.g., "t2.micro", "t3.micro") and returns the
738789// first instance type in the list that is available in all Availability Zones (AZs) in the given region. If there's no
739790// instance available in all AZs, this function exits with an error. This is useful because certain instance types,
0 commit comments