Skip to content

[Feature] Allow deploying from a given AMI image #626

@kpouget

Description

@kpouget

Would be nice to be able to deploy the CRC/SNC with a given AMI image ID, instead of letting mapt search from it.

I currently do this with this hacky code:

	// Get AMI
	amiID := os.Getenv("CUSTOM_AMI_ID")
	var ami *ec2.LookupAmiResult
	var err error
	if amiID == "" {
		logging.Info("CUSTOM_AMI_ID not set, searching for the right AMI in AWS ...")
		ami, err = amiSVC.GetAMIByName(ctx,
			fmt.Sprintf("%s*", amiName(r.version, r.arch)),
			[]string{"self", amiOwner},
			map[string]string{
				"architecture": *r.arch})
		if err != nil {
			return err
		}
	} else {
		ami = &ec2.LookupAmiResult{
			Id: amiID, // Your custom AMI ID
		}
	}

which allows me to launch

CUSTOM_AMI_ID=ami-... out/mapt aws openshift-snc create ...

but that could be made more user-friendly

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions