code: func (f *Function) CreateOrUpdateAlias(alias, version string) error {
  	_, err := f.Service.CreateAlias(&lambda.CreateAliasInput{
  		FunctionName:    &f.FunctionName,
  		FunctionVersion: &version,
  		Name:            &alias,
  	})
  
  	if err == nil {
  		f.Log.WithField("version", version).Infof("created alias %s", alias)
  		return nil
  	}
  
  	if e, ok := err.(awserr.Error); !ok || e.Code() != "ResourceConflictException" {
  		return err
  	}
  
  	_, err = f.Service.UpdateAlias(&lambda.UpdateAliasInput{
  		FunctionName:    &f.FunctionName,
  		FunctionVersion: &version,
  		Name:            &alias,
  	})
  
  	if err != nil {
  		return err
  	}
  
  	f.Log.WithField("version", version).Infof("updated alias %s", alias)
  	return nil
  }
docs: // CreateOrUpdateAlias attempts creating the alias, or updates if it already exists.