diff --git a/pkg/asset/rhcos/image.go b/pkg/asset/rhcos/image.go index 81a8f8ceb0e..a56de04a684 100644 --- a/pkg/asset/rhcos/image.go +++ b/pkg/asset/rhcos/image.go @@ -58,6 +58,10 @@ func (i *Image) Generate(p asset.Parents) error { defer cancel() switch config.Platform.Name() { case aws.Name: + if len(config.Platform.AWS.AMIID) > 0 { + osimage = config.Platform.AWS.AMIID + break + } osimage, err = rhcos.AMI(ctx, config.Platform.AWS.Region) case gcp.Name: case libvirt.Name: diff --git a/pkg/types/aws/platform.go b/pkg/types/aws/platform.go index f1d5042c255..5ecf153a5bb 100644 --- a/pkg/types/aws/platform.go +++ b/pkg/types/aws/platform.go @@ -3,6 +3,10 @@ package aws // Platform stores all the global configuration that all machinesets // use. type Platform struct { + // AMIID is the AMI that should be used to boot machines for the cluster. + // If set, the AMI should belong to the same region as the cluster. + AMIID string `json:"amiID,omitempty"` + // Region specifies the AWS region where the cluster will be created. Region string `json:"region"`