@@ -22,13 +22,6 @@ const (
2222 CentOsAccountID = "679593333241"
2323 // AmazonAccountID is the AWS account ID (or alias) for Amazon.
2424 AmazonAccountID = "amazon"
25-
26- // Deprecated: Use [CanonicalAccountID] instead.
27- CanonicalAccountId = CanonicalAccountID //nolint:staticcheck,revive // preserving deprecated constant name
28- // Deprecated: Use [CentOsAccountID] instead.
29- CentOsAccountId = CentOsAccountID //nolint:staticcheck,revive // preserving deprecated constant name
30- // Deprecated: Use [AmazonAccountID] instead.
31- AmazonAccountId = AmazonAccountID //nolint:staticcheck,revive // preserving deprecated constant name
3225)
3326
3427// DeleteAmiAndAllSnapshotsContextE will delete the given AMI along with all EBS snapshots that backed that AMI.
@@ -63,22 +56,6 @@ func DeleteAmiAndAllSnapshotsContext(t testing.TestingT, ctx context.Context, re
6356 require .NoError (t , err )
6457}
6558
66- // DeleteAmiAndAllSnapshots will delete the given AMI along with all EBS snapshots that backed that AMI.
67- //
68- // Deprecated: Use [DeleteAmiAndAllSnapshotsContext] instead.
69- func DeleteAmiAndAllSnapshots (t testing.TestingT , region string , ami string ) {
70- t .Helper ()
71-
72- DeleteAmiAndAllSnapshotsContext (t , context .Background (), region , ami )
73- }
74-
75- // DeleteAmiAndAllSnapshotsE will delete the given AMI along with all EBS snapshots that backed that AMI.
76- //
77- // Deprecated: Use [DeleteAmiAndAllSnapshotsContextE] instead.
78- func DeleteAmiAndAllSnapshotsE (t testing.TestingT , region string , ami string ) error {
79- return DeleteAmiAndAllSnapshotsContextE (t , context .Background (), region , ami )
80- }
81-
8259// GetEbsSnapshotsForAmiContextE retrieves the EBS snapshots which back the given AMI.
8360// The ctx parameter supports cancellation and timeouts.
8461func GetEbsSnapshotsForAmiContextE (t testing.TestingT , ctx context.Context , region string , ami string ) ([]string , error ) {
@@ -124,22 +101,6 @@ func GetEbsSnapshotsForAmiContext(t testing.TestingT, ctx context.Context, regio
124101 return snapshots
125102}
126103
127- // GetEbsSnapshotsForAmi retrieves the EBS snapshots which back the given AMI.
128- //
129- // Deprecated: Use [GetEbsSnapshotsForAmiContext] instead.
130- func GetEbsSnapshotsForAmi (t testing.TestingT , region string , ami string ) []string {
131- t .Helper ()
132-
133- return GetEbsSnapshotsForAmiContext (t , context .Background (), region , ami )
134- }
135-
136- // GetEbsSnapshotsForAmiE retrieves the EBS snapshots which back the given AMI.
137- //
138- // Deprecated: Use [GetEbsSnapshotsForAmiContextE] instead.
139- func GetEbsSnapshotsForAmiE (t testing.TestingT , region string , ami string ) ([]string , error ) {
140- return GetEbsSnapshotsForAmiContextE (t , context .Background (), region , ami )
141- }
142-
143104// GetMostRecentAmiIDContextE gets the ID of the most recent AMI in the given region that has the given owner and matches
144105// the given filters. Each filter should correspond to the name and values of a filter supported by DescribeImagesInput:
145106// https://docs.aws.amazon.com/sdk-for-go/api/service/ec2/#DescribeImagesInput
@@ -189,46 +150,6 @@ func GetMostRecentAmiIDContext(t testing.TestingT, ctx context.Context, region s
189150 return amiID
190151}
191152
192- // GetMostRecentAmiID gets the ID of the most recent AMI in the given region that has the given owner and matches
193- // the given filters. Each filter should correspond to the name and values of a filter supported by DescribeImagesInput:
194- // https://docs.aws.amazon.com/sdk-for-go/api/service/ec2/#DescribeImagesInput
195- //
196- // Deprecated: Use [GetMostRecentAmiIDContext] instead.
197- func GetMostRecentAmiID (t testing.TestingT , region string , ownerID string , filters map [string ][]string ) string {
198- t .Helper ()
199-
200- return GetMostRecentAmiIDContext (t , context .Background (), region , ownerID , filters )
201- }
202-
203- // GetMostRecentAmiIDE gets the ID of the most recent AMI in the given region that has the given owner and matches
204- // the given filters. Each filter should correspond to the name and values of a filter supported by DescribeImagesInput:
205- // https://docs.aws.amazon.com/sdk-for-go/api/service/ec2/#DescribeImagesInput
206- //
207- // Deprecated: Use [GetMostRecentAmiIDContextE] instead.
208- func GetMostRecentAmiIDE (t testing.TestingT , region string , ownerID string , filters map [string ][]string ) (string , error ) {
209- return GetMostRecentAmiIDContextE (t , context .Background (), region , ownerID , filters )
210- }
211-
212- // GetMostRecentAmiId gets the ID of the most recent AMI in the given region that has the given owner and matches
213- // the given filters.
214- //
215- // Deprecated: Use [GetMostRecentAmiID] instead.
216- //
217- //nolint:staticcheck,revive // preserving deprecated function name
218- func GetMostRecentAmiId (t testing.TestingT , region string , ownerId string , filters map [string ][]string ) string {
219- return GetMostRecentAmiIDContext (t , context .Background (), region , ownerId , filters )
220- }
221-
222- // GetMostRecentAmiIdE gets the ID of the most recent AMI in the given region that has the given owner and matches
223- // the given filters.
224- //
225- // Deprecated: Use [GetMostRecentAmiIDE] instead.
226- //
227- //nolint:staticcheck,revive // preserving deprecated function name
228- func GetMostRecentAmiIdE (t testing.TestingT , region string , ownerId string , filters map [string ][]string ) (string , error ) {
229- return GetMostRecentAmiIDContextE (t , context .Background (), region , ownerId , filters )
230- }
231-
232153// Image sorting code borrowed from: https://github.com/hashicorp/packer/blob/7f4112ba229309cfc0ebaa10ded2abdfaf1b22c8/builder/amazon/common/step_source_ami_info.go
233154type imageSort []types.Image
234155
@@ -274,22 +195,6 @@ func GetUbuntu1404AmiContext(t testing.TestingT, ctx context.Context, region str
274195 return amiID
275196}
276197
277- // GetUbuntu1404Ami gets the ID of the most recent Ubuntu 14.04 HVM x86_64 EBS GP2 AMI in the given region.
278- //
279- // Deprecated: Use [GetUbuntu1404AmiContext] instead.
280- func GetUbuntu1404Ami (t testing.TestingT , region string ) string {
281- t .Helper ()
282-
283- return GetUbuntu1404AmiContext (t , context .Background (), region )
284- }
285-
286- // GetUbuntu1404AmiE gets the ID of the most recent Ubuntu 14.04 HVM x86_64 EBS GP2 AMI in the given region.
287- //
288- // Deprecated: Use [GetUbuntu1404AmiContextE] instead.
289- func GetUbuntu1404AmiE (t testing.TestingT , region string ) (string , error ) {
290- return GetUbuntu1404AmiContextE (t , context .Background (), region )
291- }
292-
293198// GetUbuntu1604AmiContextE gets the ID of the most recent Ubuntu 16.04 HVM x86_64 EBS GP2 AMI in the given region.
294199// The ctx parameter supports cancellation and timeouts.
295200func GetUbuntu1604AmiContextE (t testing.TestingT , ctx context.Context , region string ) (string , error ) {
@@ -315,22 +220,6 @@ func GetUbuntu1604AmiContext(t testing.TestingT, ctx context.Context, region str
315220 return amiID
316221}
317222
318- // GetUbuntu1604Ami gets the ID of the most recent Ubuntu 16.04 HVM x86_64 EBS GP2 AMI in the given region.
319- //
320- // Deprecated: Use [GetUbuntu1604AmiContext] instead.
321- func GetUbuntu1604Ami (t testing.TestingT , region string ) string {
322- t .Helper ()
323-
324- return GetUbuntu1604AmiContext (t , context .Background (), region )
325- }
326-
327- // GetUbuntu1604AmiE gets the ID of the most recent Ubuntu 16.04 HVM x86_64 EBS GP2 AMI in the given region.
328- //
329- // Deprecated: Use [GetUbuntu1604AmiContextE] instead.
330- func GetUbuntu1604AmiE (t testing.TestingT , region string ) (string , error ) {
331- return GetUbuntu1604AmiContextE (t , context .Background (), region )
332- }
333-
334223// GetUbuntu2004AmiContextE gets the ID of the most recent Ubuntu 20.04 HVM x86_64 EBS GP2 AMI in the given region.
335224// The ctx parameter supports cancellation and timeouts.
336225func GetUbuntu2004AmiContextE (t testing.TestingT , ctx context.Context , region string ) (string , error ) {
@@ -356,22 +245,6 @@ func GetUbuntu2004AmiContext(t testing.TestingT, ctx context.Context, region str
356245 return amiID
357246}
358247
359- // GetUbuntu2004Ami gets the ID of the most recent Ubuntu 20.04 HVM x86_64 EBS GP2 AMI in the given region.
360- //
361- // Deprecated: Use [GetUbuntu2004AmiContext] instead.
362- func GetUbuntu2004Ami (t testing.TestingT , region string ) string {
363- t .Helper ()
364-
365- return GetUbuntu2004AmiContext (t , context .Background (), region )
366- }
367-
368- // GetUbuntu2004AmiE gets the ID of the most recent Ubuntu 20.04 HVM x86_64 EBS GP2 AMI in the given region.
369- //
370- // Deprecated: Use [GetUbuntu2004AmiContextE] instead.
371- func GetUbuntu2004AmiE (t testing.TestingT , region string ) (string , error ) {
372- return GetUbuntu2004AmiContextE (t , context .Background (), region )
373- }
374-
375248// GetUbuntu2204AmiContextE gets the ID of the most recent Ubuntu 22.04 HVM x86_64 EBS GP2 AMI in the given region.
376249// The ctx parameter supports cancellation and timeouts.
377250func GetUbuntu2204AmiContextE (t testing.TestingT , ctx context.Context , region string ) (string , error ) {
@@ -397,22 +270,6 @@ func GetUbuntu2204AmiContext(t testing.TestingT, ctx context.Context, region str
397270 return amiID
398271}
399272
400- // GetUbuntu2204Ami gets the ID of the most recent Ubuntu 22.04 HVM x86_64 EBS GP2 AMI in the given region.
401- //
402- // Deprecated: Use [GetUbuntu2204AmiContext] instead.
403- func GetUbuntu2204Ami (t testing.TestingT , region string ) string {
404- t .Helper ()
405-
406- return GetUbuntu2204AmiContext (t , context .Background (), region )
407- }
408-
409- // GetUbuntu2204AmiE gets the ID of the most recent Ubuntu 22.04 HVM x86_64 EBS GP2 AMI in the given region.
410- //
411- // Deprecated: Use [GetUbuntu2204AmiContextE] instead.
412- func GetUbuntu2204AmiE (t testing.TestingT , region string ) (string , error ) {
413- return GetUbuntu2204AmiContextE (t , context .Background (), region )
414- }
415-
416273// GetCentos7AmiContextE returns a CentOS 7 public AMI from the given region.
417274// WARNING: you may have to accept the terms & conditions of this AMI in AWS MarketPlace for your AWS Account before
418275// you can successfully launch the AMI.
@@ -442,26 +299,6 @@ func GetCentos7AmiContext(t testing.TestingT, ctx context.Context, region string
442299 return amiID
443300}
444301
445- // GetCentos7Ami returns a CentOS 7 public AMI from the given region.
446- // WARNING: you may have to accept the terms & conditions of this AMI in AWS MarketPlace for your AWS Account before
447- // you can successfully launch the AMI.
448- //
449- // Deprecated: Use [GetCentos7AmiContext] instead.
450- func GetCentos7Ami (t testing.TestingT , region string ) string {
451- t .Helper ()
452-
453- return GetCentos7AmiContext (t , context .Background (), region )
454- }
455-
456- // GetCentos7AmiE returns a CentOS 7 public AMI from the given region.
457- // WARNING: you may have to accept the terms & conditions of this AMI in AWS MarketPlace for your AWS Account before
458- // you can successfully launch the AMI.
459- //
460- // Deprecated: Use [GetCentos7AmiContextE] instead.
461- func GetCentos7AmiE (t testing.TestingT , region string ) (string , error ) {
462- return GetCentos7AmiContextE (t , context .Background (), region )
463- }
464-
465302// GetAmazonLinuxAmiContextE returns an Amazon Linux AMI HVM, SSD Volume Type public AMI for the given region.
466303// The ctx parameter supports cancellation and timeouts.
467304func GetAmazonLinuxAmiContextE (t testing.TestingT , ctx context.Context , region string ) (string , error ) {
@@ -487,22 +324,6 @@ func GetAmazonLinuxAmiContext(t testing.TestingT, ctx context.Context, region st
487324 return amiID
488325}
489326
490- // GetAmazonLinuxAmi returns an Amazon Linux AMI HVM, SSD Volume Type public AMI for the given region.
491- //
492- // Deprecated: Use [GetAmazonLinuxAmiContext] instead.
493- func GetAmazonLinuxAmi (t testing.TestingT , region string ) string {
494- t .Helper ()
495-
496- return GetAmazonLinuxAmiContext (t , context .Background (), region )
497- }
498-
499- // GetAmazonLinuxAmiE returns an Amazon Linux AMI HVM, SSD Volume Type public AMI for the given region.
500- //
501- // Deprecated: Use [GetAmazonLinuxAmiContextE] instead.
502- func GetAmazonLinuxAmiE (t testing.TestingT , region string ) (string , error ) {
503- return GetAmazonLinuxAmiContextE (t , context .Background (), region )
504- }
505-
506327// GetEcsOptimizedAmazonLinuxAmiContextE returns an Amazon ECS-Optimized Amazon Linux AMI for the given region. This AMI is useful for running an ECS cluster.
507328// The ctx parameter supports cancellation and timeouts.
508329func GetEcsOptimizedAmazonLinuxAmiContextE (t testing.TestingT , ctx context.Context , region string ) (string , error ) {
@@ -528,22 +349,6 @@ func GetEcsOptimizedAmazonLinuxAmiContext(t testing.TestingT, ctx context.Contex
528349 return amiID
529350}
530351
531- // GetEcsOptimizedAmazonLinuxAmi returns an Amazon ECS-Optimized Amazon Linux AMI for the given region. This AMI is useful for running an ECS cluster.
532- //
533- // Deprecated: Use [GetEcsOptimizedAmazonLinuxAmiContext] instead.
534- func GetEcsOptimizedAmazonLinuxAmi (t testing.TestingT , region string ) string {
535- t .Helper ()
536-
537- return GetEcsOptimizedAmazonLinuxAmiContext (t , context .Background (), region )
538- }
539-
540- // GetEcsOptimizedAmazonLinuxAmiE returns an Amazon ECS-Optimized Amazon Linux AMI for the given region. This AMI is useful for running an ECS cluster.
541- //
542- // Deprecated: Use [GetEcsOptimizedAmazonLinuxAmiContextE] instead.
543- func GetEcsOptimizedAmazonLinuxAmiE (t testing.TestingT , region string ) (string , error ) {
544- return GetEcsOptimizedAmazonLinuxAmiContextE (t , context .Background (), region )
545- }
546-
547352// NoImagesFound is an error that occurs if no images were found.
548353type NoImagesFound struct {
549354 Filters map [string ][]string
0 commit comments